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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Set Expression in Pivot Table

Hi Friends

I have shown the following screen shot of my pivot table

Screenshot_1.png

My expression for the above is 

(sum({<MONTH={"<=$(=max(MONTH))"},YEAR={$(=max(YEAR))},MO_NM={'MOTOR'}>}PREMIUM)/
sum({<MONTH={"<=$(=max(MONTH))"},YEAR={$(=max(YEAR)-1)},MO_NM={'MOTOR'}>}PREMIUM)-1)*100

What I want  is  when  I select a particular MONTH all months less than the selected month should show calculation as above and rest of the months  eg: May-Dec  should show zero value. Kindly help me to modify my expression to show zero values for other months.

4 Replies
upaliwije
Creator II
Creator II
Author

My Friends,

Pls help me with asolution

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You just need to wrap your current expression with an if() like this:

if(MONTH > Max(TOTAL MONTH), 0, 
your current expression
)

-Rob

upaliwije
Creator II
Creator II
Author

Thanks

I have put it like this

if(MONTH > Max(TOTAL MONTH), 0,
(sum({<MONTH={"<=$(=max(MONTH))"},YEAR={$(=max(YEAR))},MO_NM={'MOTOR'}>}PREMIUM)/
sum({<MONTH={"<=$(=max(MONTH))"},YEAR={$(=max(YEAR)-1)},MO_NM={'MOTOR'}>}PREMIUM)-1)*100)

Still the output is the same , No months appear after max month

Brett_Bleess
Former Employee
Former Employee

About the best I can do in addition to Rob's comment is some links that might be of some help:

Help site:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

Design Blog:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

There are additional posts in the Design Blog area too, just FYI.  Hopefully this may help you get things sorted.

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.