Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dilipkumard13
Contributor III
Contributor III

How Create The Sequence As per Items in Script

Dear Qlik,

I Have 1 Requirement as i need to Give an Sequence Num as Per the Items.

it Should Start From 1.

Ex :

  

Index SequenceItemDate
11Orange01-Sep-18
22Orange02-Sep-18
33Orange03-Sep-18
41Apple04-Sep-18
52Apple05-Sep-18
61PineApple06-Sep-18
72PineApple07-Sep-18
83PineApple08-Sep-18
1 Solution

Accepted Solutions
sunny_talwar

May be try this

AutoNumber(RowNo(), Item)

View solution in original post

2 Replies
sunny_talwar

May be try this

AutoNumber(RowNo(), Item)

sunny_talwar

Or using Peek() function

If(Peek('Item') = Item, RangeSum(Peek('Sequence'), 1), 1) as Sequence

But make sure to sort the data using Order by before you apply AutoNumber or Peek()