Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a column based on index value in another column

l have a table which contains 2 columns: number and  order. l need a column "next_number" . l want to have the value of next row of the column number sort  by order. when the next number is null, we ...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    4 years ago

    Hi,

    Thank you for your feedback, and sorry that I missed your requirement.

    Could you please check if the below and the attached pibx file are providing a correct result? 

     

     

     

    Next number CC =
    VAR nextorder =
        MINX (
            FILTER ( Data, Data[order] > EARLIER ( Data[order] ) && Data[Number] <> 0 ),
            Data[order]
        )
    RETURN
        MAXX ( FILTER ( Data, Data[order] = nextorder ), Data[Number] )