How to add index number in the dataset

user041053 βšͺ️
edited May 19 in Dataflows

Hi Team,

I have a dataset with around 1000 records. now I want to add one field in it name "id".

it would be starting from 1 and end with 1000.

I don't have an idea how to add it. Please suggest a better way.

Thanks in advance :)



  • jaeW_at_Onyx
    jaeW_at_Onyx Budapest / Portland, OR 🟀

    in magic etl

    add a constant, 1, called temp

    add a rank and window tile.

    • rownumber
    • order by temp
    • no partition.

    in a dataset view

    rownumber() over ()

  • GrantSmith
    GrantSmith Indiana πŸ”΄

    To expand on @jaeW_at_Onyx 's answer - The rank and window tile requires a column to order by. That's why you must add a dummy constant / column to your dataset