Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a sequencenumber (based on date) within a same articlenumber

Hi,

I need to create %2TalSeq:

Within the same value of %2Tal , the numbering has to restart at 1.

%2TalDate%2TalSeq
°1°2°26-12-20081
°1°3°14-05-20041
°1°3°10-12-20042
°1°3°29-09-20063
°1°3°24-08-20074
°1°4°09-04-20041
°1°4°26-11-20042
°1°4°27-07-20073
°1°5°12-02-20101
°1°6°25-11-20051
°1°6°29-09-20062

Thanks

Paul

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If you need to do it in the script, you can use functions previous() and peek() to compare the value of the Items and assign the Counter accordingly.

Something like this:


load
Item,
Date,
if(previous(Item) <> Item, 1, peek(Counter) + 1) as Counter
resident
Tab1
Order By
Item, Date
;


Ask me about Qlik Sense Expert Class!
Not applicable
Author

Oleg,

Thank you.

Paul