Forum Discussion
biwarrior93
3 years agoRegular Visitor
assign index based on criteria
Hello, I have a table with the following columns: ID, Email, Phone 1 and Phone 2. All the IDs are unique. I need to assign a unique index to each record. However, the records that either have the s...
wdx223_Daniel
Community Champion
3 years ago= let fx=(rcd)=>let a=Record.ToList(rcd) in Text.Combine(List.Transform(List.FirstN(a,2)&List.Sort(List.Skip(a,2)),Text.From),"|"),
grp=Table.Group(YourTableName,Table.ColumnNames(YourTableName),{"n",each _},1,(x,y)=>Value.Compare(fx(x),fx(y)))
in Table.Combine(Table.TransformRows(Table.AddIndexColumn(grp,"idx"),each Table.AddColumn([n],"idx",(x)=>[idx])))biwarrior93
3 years agoRegular Visitor
I changed the table name with mine and I get the error below :
Expression. Error: A cyclic reference was encountered during evaluation.