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

How to sum only the values of the last month

Hi,

I have customers with sales and credits by year, by month. I want that when the user is selecting multiple months to sum only the sales of the last month.

I tried without succes a formula like this :

sum({$<Month ={vMonth}>} Sales)

where vMonth is a varibale that calculates the max(Month)

If someone has another idea I'll apreciate.

Thanks

4 Replies
m_woolf
Master II
Master II

Try:

sum({$<Month ={'$(vMonth)'}>} Sales)

MayilVahanan

Hi

     sum({$<Month ={'$(vMonth)'}>} Sales)

Hope it helps

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

Hi,

I tried this but is still not working.

Thanks

Not applicable
Author

I fund myself the answer, I should use an if, like this :

sum(if(Month=vMonth, Sales ,0))

Thank you!!!