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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Row Counter on load

Hi There,

I looking to get a solution where I can have a row counter that would reset if a new parent list is loaded

e.g. like follows

main mem mem no counter
1000 5 1
1000 6 2
1000 7 3
1000 8 4
1001 9 1
1001 10 2
1001 11 3
1001 12 1
1001 13 2

I'm trying to do this on load as I need to do some calculations on an expression.

Thanks,
Kevin.

5 Replies
Not applicable
Author

Apologies. I gave the example incorrectly. It should be

main mem mem no counter
1000 5 1
1000 6 2
1000 7 3
1000 8 4
1001 9 1
1001 10 2
1001 11 3
1002 12 1
1002 13 2

Thanks,
Kevin.

stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi Kevin,

Something like this would work to bring that value into a Members table:


Left Join (Members)
Load
"main mem",
"mem no",
if("main mem" = Previous("main mem"),
Peek('counter', -1) + 1,
1) As counter
Resident Members
Order by "main mem", "mem no";


Stephen

Not applicable
Author

Hi Kevin,

here are an working example.

Steven is on the same track.

Have a nice weekend!

Rainer

Not applicable
Author

Thanks guys.

Just what I needed Big Smile

Kevin.

Not applicable
Author

How do i achieve Runningsum (communicative Sum of 12 months) using load script ?

Following is the expression i am using to create RunningSum in QV however i want to push this expression to load script. Please help !

RangeSum

(above(Sum([Actual Demand]),0,12))





DateActual DemandRunningSum
12323
23457
356113
434147
556203
676279
734313
887400
97561156
10341190
118762066
123432409
1323454731
14894786
15454775
163445085
177865815
183436082
199787026
203437282
21236549
225677082
23456251
24345942
25233620
26563587
27783620