How to add index number in the dataset

Options
user041053
user041053 Member
edited May 2021 in Magic ETL

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 :)

Tagged:

Answers

  • jaeW_at_Onyx
    Options

    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 ()

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • GrantSmith
    Options

    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

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**