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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
EliGohar
Partner - Specialist
Partner - Specialist

Calcualte Accumulation in script

Hi all,

I have data of entry and exit by hour, I want to calculate the accumulation (Entry-Exit) in the script and have this table for example:

Hour (hh)EntryExitAccumulation
0:0029519996
1:00300191205
2:00286204287
3:00302202387
4:00284194477
5:00292197572
6:00302198676
7:00298193781
8:00292196877
9:00299200976
10:00157981035
11:00351033

 

How can I achieve this result?

Thanks,

Eli.

Labels (1)
2 Replies
Taoufiq_Zarra

Hi,

One solution :

LOAD if(rowno()=1,(Entry-Exit),peek(Accumulation)+(Entry-Exit)) as Accumulation,* INLINE [
    Hour (hh), Entry, Exit
    0:00, 295, 199
    1:00, 300, 191
    2:00, 286, 204
    3:00, 302, 202
    4:00, 284, 194
    5:00, 292, 197
    6:00, 302, 198
    7:00, 298, 193
    8:00, 292, 196
    9:00, 299, 200
    10:00, 157, 98
    11:00, 3, 5
];

 

output :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
EliGohar
Partner - Specialist
Partner - Specialist
Author

@Taoufiq_Zarra Thanks!!!