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

Need Help For Sum Function

Hi everyone,

When multiple selections are made on the data model,I just want to process the biggest one. The code structure looks like this:

((Sum({$<Year={"=$(=(Max(Year)))"}, Month={"<=$(=(Max(Month)))"}> } In_Qty)) -

(Sum({$<Year={"=$(=(Max(Year)))"}, Month={"<=$(=(Max(Month)))"}>} Out_Qty)))

For example, when I choose 2015-2016-2017-2018,  I want sum of data for 2018. This code is included all the years.

Please help me.

7 Replies
sunny_talwar

May be try this (Remove the equal sign before the dollar sign expansion for Year's modifier

((Sum({$<Year={"$(=(Max(Year)))"}, Month={"<=$(=(Max(Month)))"}> } In_Qty)) -

(Sum({$<Year={"$(=(Max(Year)))"}, Month={"<=$(=(Max(Month)))"}>} Out_Qty)))

shiveshsingh
Master
Master

Hi Sunny

I think '=' sign before $ is not the correct way while using set analysis?


Sum({$<Year={"=$(=(Max(Year)))"}

sunny_talwar

I believe so... that is why I recommended to remove it.

shiveshsingh
Master
Master

Thanks

sunny_talwar

Hahahaha no problem

Anonymous
Not applicable
Author

Thank you so much guys

İt works

shiveshsingh
Master
Master

Please close the thread