jimrward
Well-known Member
- Joined
- Feb 24, 2003
- Messages
- 1,899
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- 2003 or older
- Platform
- Windows
Complete novice here but bumbling along, I have around 200k lines of source data by 35 columns, of which one of the columns call it TargetID can have repeat rows from 1 to 60,
I am trying to add a custom column that flags 1 if its the first instance of the targetid sequence and 0 if it aint
what I have below appears to work albeit very slowly
I have seen references to List.Buffer and Table.buffer to load things into memory but need some guidance to get my head around it, here is my current code gleaned from various searches, source is an external CSV file
I am trying to add a custom column that flags 1 if its the first instance of the targetid sequence and 0 if it aint
what I have below appears to work albeit very slowly
I have seen references to List.Buffer and Table.buffer to load things into memory but need some guidance to get my head around it, here is my current code gleaned from various searches, source is an external CSV file
Power Query:
let
Source = logExport_Current,
#"Added Custom" = Table.AddColumn(Source, "Custom", each List.PositionOf( Source[TargetID], [TargetID]) ),
#"Added Index" = Table.AddIndexColumn(#"Added Custom", "Index", 0, 1, Int64.Type),
#"Added Custom1" = Table.AddColumn(#"Added Index", "Flag", each Number.From([Custom]=[Index])),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Custom", "Index"})
in
#"Removed Columns"
Last edited by a moderator: