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: 
mikecherry
Contributor III
Contributor III

Create cumulative numbers in load script

Hi all,

I am trying to get cumulative numbers in the load script like I have calculated using rangesum in the table below.

You can find attached the app and the data.

mikecherry_0-1588851022841.png

 

Labels (2)
13 Replies
DesmoArka
Partner - Contributor III
Partner - Contributor III

I use your script at all.

I thing you are wrong only graph and not script.

Create this pivot and check if it's ok:

DesmoArka_0-1588940940785.png

 

You must have Bunit in Graph

 

DesmoArka
Partner - Contributor III
Partner - Contributor III

This is my file.

DesmoArka
Partner - Contributor III
Partner - Contributor III

and remenber that you are summing a field with cumulated value, u can't use that to total calculation.

Add this to the script:

left Join
load max(TransValueDate) as TransValueDate,
BUnit,
TransCcy,
1 as max_data
Resident Transactions1
Group by BUnit,
TransCcy;

 

and use this measure in my pivot:

if (Dimensionality()<=1, sum(aggr(Sum({<max_data={1}>}Trans_CUM),BUnit,TransCcy)), Sum(Trans_CUM))

 

I attached all file

mikecherry
Contributor III
Contributor III
Author

Thank you man ! In the end I had to do a group by before your script as I had multiple transactions at the same date but after that I have used your script and works great !

 

Ciao

 

Michele