Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
djaykumar
Contributor
Contributor

Calculate the percentage with different groups

Hi All,

I am having issue with Percentage calculation with different group elements.

Please find below my report

GroupName SBU Mod  Amount
Sales Commission 204,045,960
Sales Customer Support 989,000,000
Sales Manufacturing -Parts Export 56,702,200
Sales Slim 1,511,273,500
Sales Turnkey 830,075,000
Material  Cost Customer Support -411,150,000
Material  Cost Manufacturing -Parts Export -33,371,320
Material  Cost Slim -1,049,064,100
Material  Cost Turnkey -570,420,000

In the above report Client wants the percentage calculation ie.,  materialcost  Customer Support (-411150000) divided by

sales Customer Support (989000000) and MaterialCost Manufacturing Parts Export (-33371320) divided by sales Manufacturing Parts Export (56702200) and so on...

And all the calculated Percentages will be displayed only in material cost respective fields and in sales fields it should show 0.

Please help me in this.

Regards,

Jay

 

1 Solution

Accepted Solutions
sunny_talwar

Seems like you have two spaces between Material and Cost... try this

Sum({<GroupName = {"Material  Cost"}>} [Mod  Amount])
/
Sum(TOTAL <SBU> {<GroupName = {"Sales"}>} [Mod  Amount])

This worked for me in QlikView

image.png

View solution in original post

4 Replies
sunny_talwar

Try this

Sum({<GroupName = {"Material Cost"}>} [Mod Amount])
/
Sum(TOTAL <SBU> {<GroupName = {"Sales"}>} [Mod Amount])
djaykumar
Contributor
Contributor
Author

Hi Sunny,
Thanks for quick Reply
But I am getting 0 with the above code.
Please help me
Regards,
Jay
sunny_talwar

Seems like you have two spaces between Material and Cost... try this

Sum({<GroupName = {"Material  Cost"}>} [Mod  Amount])
/
Sum(TOTAL <SBU> {<GroupName = {"Sales"}>} [Mod  Amount])

This worked for me in QlikView

image.png

View solution in original post

djaykumar
Contributor
Contributor
Author

Hi Sunny,
Its working perfectly .
Thank you very much
Regards,
Jay