add an incremental column in dataset

Solved!
deep_215
Level 2
add an incremental column in dataset

 requirement is to add an incremental column in datset, it should not be an identity column however data in it will be unique.

0 Kudos
1 Solution
Manuel
Dataiker Alumni

Hi,

You can use a Window recipe for this:

  • In the Window definition, enable a order column
  • In the Aggregations definition, compute the Row Number
  • See attached image

For an overview of the Window recipe, check :

I hope this helps.

View solution in original post

3 Replies
Manuel
Dataiker Alumni

Hi,

You can use a Window recipe for this:

  • In the Window definition, enable a order column
  • In the Aggregations definition, compute the Row Number
  • See attached image

For an overview of the Window recipe, check :

I hope this helps.

yesitsmeoffical
Level 3

is it possible to do this in the prepare recipe? not that I don't know how to use window but would like to keep all changes consolidated in a single recipe if possible

0 Kudos
bleclair
Level 2

Using a python code step in a prepare recipe:

count = 0
def process(row):
    global count
    count += 1
    return count
0 Kudos