Forum Discussion

sravani9920's avatar
sravani9920
Frequent Visitor
2 years ago
Solved

at what Index the value occurred again?

Hi Guys, Please help me out, I am providing sample data for you, Here the output should be as Next Index column  using PQE. Thanks in Advacne.   number Index Next Index 100 1 2...
  • AlienSx's avatar
    2 years ago

    hello, sravani9920 

    let
        Source = your_table,
        f = (tbl) => 
            [new_col = List.Skip(tbl[Index]) & {null},
            out = Table.FromColumns(
                Table.ToColumns(tbl) & {new_col}, 
                Table.ColumnNames(tbl) & {"Next Index"}
            )][out],
        g = Table.Group(Source, "number", {"data", f}),
        z = Table.Combine(g[data])
    in
        z