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: 
Anonymous
Not applicable

Sum with Variable

Hi All

I am trying to sum Sales for current month previous month and 2 months ago

I have variables for this and am doing the following

=(Sum({<$(vCurrentMonth) Collections))

=(Sum({<$(vPreviousMonth) Collections))

but this does not work any idea how to do this please?

Thanks alot!

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this way.

Sum({<Month = {"$(vCurrentMonth)"}>}Collections)

Sum({<Month = {"$(vPreviousMonth)"}>}Collections)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this way.

Sum({<Month = {"$(vCurrentMonth)"}>}Collections)

Sum({<Month = {"$(vPreviousMonth)"}>}Collections)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Maybe like this:

=(Sum({<Month={$(vCurrentMonth),$(vPreviousMonth)}>} Collections))


talk is cheap, supply exceeds demand
MayilVahanan

HI

Try like this

Sum({<Month={$(vCurrentMonth),$(vPreviousMonth), $(v2MonthAgo)}>} Collections)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Thanks All

This has worked !!!

Thanks

Kaushik Solanki