Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
noman212
Creator III
Creator III

RangeSum and Above

Hi Community, 

 

I have implemented this expression to make category against the percentange.

 

RangeSum(Above(Sum(EASYLOAD_RECH_AMT_SUM), 0, RowNo()))

 

Could you pls tell me how can i translate the logic into qlikScript

 

Regards 

Noman

Labels (3)
6 Replies
noman212
Creator III
Creator III
Author

Hello guys? 

Anyone?

Vegar
MVP
MVP

Hi @noman212 

You are using this expression against a percentage? I don't really get that info without a screenshot or a sample. However, often when I see the rangesum above expression it can be solved by a normal SUM() when implementing an "as of table" in the script. 

Take a look at HICs blog post on the as of table topic and see if you can use it to  solve your percentage scenario. https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130

noman212
Creator III
Creator III
Author

Hi @Vegar  thanks for your reply.

i used this expression to calculate accumulated Sum and now i want to translate this expression into my script against ID.

i applied 

if(FRANCHISE_CD=Previous(FRANCHISE_CD), RangeSum(EASYLOAD_RECH_AMT_SUM, Peek('CUM_QTA_MOV_1YB'))
,Sum(EASYLOAD_RECH_AMT_SUM)) as CUM_QTA_MOV_1YB

this in my script but unable to get my result. 

Vegar
MVP
MVP

It could be your aggregations that is causing you trouble. Are you using group by or not?  Try rephrasing to see if this approach is better.

if(FRANCHISE_CD=Previous(FRANCHISE_CD),   Peek('CUM_QTA_MOV_1YB'), 0)
+ EASYLOAD_RECH_AMT_SUM as CUM_QTA_MOV_1YB

noman212
Creator III
Creator III
Author

YEs i am using group by with 2 Ids 

Franchise ID and MSNID.

the solution you proposed in script is working but it aggr on both IDS but i want to aggr on 1 franchise ID only.

Kindly suggest how can i bypass MSNID in this 

if(FRANCHISE_CD=Previous(FRANCHISE_CD),   Peek('CUM_QTA_MOV_1YB'), 0)
+ EASYLOAD_RECH_AMT_SUM as CUM_QTA_MOV_1YB

Brett_Bleess
Former Employee
Former Employee

Noman, use the following Design Blog link to search that area for 'AGGR' posts, there are quite a few, was not sure which ones might help you in this case, but I think one of the existing ones might!

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.