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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating the difference.

hi.

I got two seperate text boxes and i basically want to calculate the difference between the two in one text box,  how could i go about doing this?

=num(sum({$<Year = {2010}>}Sales),'R#,##0'),      (text box 1)

=num(sum({$<Year = {2011}>}Sales),'R#,##0')       (text box 2)

Thanks.

Labels (1)
3 Replies
Not applicable
Author

Try this:

num(sum({$<Year = {2011}>}Sales)-sum({$<Year = {2010}>}Sales),'R#,##0')

Not applicable
Author

Thanks it work.  One more thing,  uhm if i wanted the answer in a % form, how would i go on about that?

Not applicable
Author

For example if we want the sales of 2011 related to 2010:

num(sum({$<Year = {2011}>}Sales)/sum({$<Year = {2010}>}Sales)-1,'0,00%')