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: 
raghuvr33
Contributor III
Contributor III

Percentage calculation for totals

Hi all,

I have a calculation of ship profit % as sum((price - cost) / price) which is calculating correctly and displayed as % with the show in percent(%) checked for every row.

The issue i am having is that the total displayed at the bottom is showing the sum of all the percentages for the calculation instead of calculating the percentages of the totals.For the totals i am looking to display the total(price - cost) / total price.

example:

Price        Cost           %

20             10              50%

30             10              66%

------------------------------------

50             20             116%  -- Currently showing this which is sum of the two rows of data

50             20                60%  --  Need QV to show this which is  (price - cost / price) as %age. 

I would appreciate any recomendations to resolve this.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: 1 - sum(cost)/sum(price)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: 1 - sum(cost)/sum(price)


talk is cheap, supply exceeds demand
raghuvr33
Contributor III
Contributor III
Author

Thanks that did it with total mode as expression total.