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

RangeSum function in script

Hi Qlikers, 

I don't know why but i am always having troubles to create measure from front-end in data_load_editor script;
How to write this expression in script please in order to get the third column in prtscr:
RANGESUM(ABOVE(TOTAL SUM([_C_Free_Stock_Balance(Fixed)]),0,ROWNO(TOTAL)))

whatever i tried in script, i get different numbers.. 

ena1309_0-1655377779127.png

 

Labels (2)
3 Replies
marcus_sommer

It might be look like:

t: load A, B, C, if(A = previous(A), rangesum(C, peek('D')), C) as D
resident X order by A, B; 

- Marcus

ena1309
Contributor III
Contributor III
Author

unfortunately something doesn't calculate right, because with that function I get different values than when I do it front in master item 😕 

marcus_sommer

You need to adapt it to your used dimensionality - this means you may need to include more checks within the if-loop(s) as just A = previous(A) - and/or the sorting is different which is applied per order by statement.

You may just add a recno() and a rowno() within the load to see which source-record becomes now which target-record and with this information you could adjust the sorting.

- Marcus