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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Total YTD (variable)


Hello,

I have created the following table:

ytd.PNG

Here the expression I have used for the "Cost %" for the current month

num(sum(Cost)/ Sum(total(Cost)), '#,0%')

My problem is with the expression I have created for the "Cost %" for the YTD:

num(sum({<vYTD>}Cost)/ Sum(total({$<$(vYTD)>}Cost)), '#,0%') 

What am I doing wrong? How can I calculate the percentage of the cost for the YTD? Or how can I calculate the total with a Variable?

Thank you in advance for your help!

Iuri

12 Replies
sunny_talwar

That worked???

Not applicable
Author

Yes it did, thank you very much!

The way I was think "total ()", it seems that does not work in the same way with variables.

I already marked as correct.

sunny_talwar

Hahahaha ya, I saw the correct answer pop-up two times before also, so I was not sure if this was truly the correct answer or not. But I am glad it worked out for you.

Best.

Sunny