Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
JP71
Partner - Contributor
Partner - Contributor

Find start of succession

Hi guys,

 

I am looking for a way to flag all rows in a sequence. I have added a small example of the desired output below (column Calculated status) So far no luck using the previous function. Hope anyone can point me in the right direction. Thanks!

IDStatusDateLevelCalculated status
1101-01-20 
1  3 
1  0 
1  4 
1  0Stopped
1  0Stopped
1  0Stopped
12 0Stopped
21 4 
2  5 
22 0Stopped
31   
Labels (2)
2 Replies
TimvB
Creator II
Creator II

Write the following in the script editor to flag the rows where the level = 0:


TableName:

Load

*,
if(Level = 0, 'Stopped') as [Calculated status]

From YourSource;


Hope it helps!

JP71
Partner - Contributor
Partner - Contributor
Author

Hi Tim, I failed to illustrate the following in the example.

The calculated status can only be 'Stopped' if the end of the  bottom row where status = 2 and level = 0. All above 0 should also become 'stopped' until the first none 0 has been reached. 

 

I have updated my example