Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Total Sales minus Current Year

Hello,

¿There is a way to get on a button the total sales minus current year?

Thank you

5 Replies
tom2qlik
Creator
Creator

You could try set analysis in the button expression.

Sum(Sales)-Sum({$<This Year = {1}>}Sales)

Use you identifier/flag for this year in the set analysis of the second sum.

tom2qlik
Creator
Creator

I may have misunderstood what you are asking.

Do you want the calculation in a text object that appears once you click on the button?

If you can explain what you want the button to do, that help in providing a more accurate answer.

Tom

Anonymous
Not applicable
Author

Hello,

you are right, i ment in a text objext

sunny_talwar

May be like this

Sum({<Year = {"$(='<=' & Max(Year))"}>}Sales)

tom2qlik
Creator
Creator

Within the text object text box -

=Sum(Sales)-Sum({$<Year = {This year}>}Sales)

That should work.