Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I get a calculated column in a pivot where I would like to present the % related to sales?
Period | |||||
2020-01 | 2020-02 | ||||
Category | Name | Amount | % | Amount | % |
10 | Sales | 1000 | 1000 | ||
20 | Cost of sales | -500 | -500 | ||
30 | Gross Margin | 500 | 500 |
I thought with a measure, but I'm not getting the right expression.
For example: sum(Amount) / sum ({<Category=10>} Amount) only shows 100% on the sales row.
Any help would be great!
With the help of another post.
https://community.qlik.com/t5/New-to-Qlik-Sense/Pivot-with-expression-column/m-p/1768583#M176626
This should be the result: sum(Amount) / sum ({$<[Category]={10}>} Total <Period> Amount)
@mvs01 can you share the expected output ?
Here's the expected output, I changed some values for insight.
Period | |||||
2020-01 | 2020-02 | ||||
Category | Name | Amount | % | Amount | % |
10 | Sales | 1000 | 100% | 1000 | 100% |
20 | Cost of sales | -500 | -50% | -600 | -60% |
30 | Gross Margin | 500 | 50% | 400 | 40% |
With the help of another post.
https://community.qlik.com/t5/New-to-Qlik-Sense/Pivot-with-expression-column/m-p/1768583#M176626
This should be the result: sum(Amount) / sum ({$<[Category]={10}>} Total <Period> Amount)