Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mvs01
Contributor II
Contributor II

Pivot with percentage column

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 
CategoryNameAmount%Amount%
10Sales1000 1000 
20Cost of sales-500 -500 
30Gross Margin500 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!

1 Solution

Accepted Solutions
mvs01
Contributor II
Contributor II
Author

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)

View solution in original post

3 Replies
Taoufiq_Zarra

@mvs01  can you share the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
mvs01
Contributor II
Contributor II
Author

@Taoufiq_Zarra 

Here's the expected output, I changed some values for insight.

  Period   
  2020-01 2020-02 
CategoryNameAmount%Amount%
10Sales1000100%1000100%
20Cost of sales-500-50%-600-60%
30Gross Margin50050%40040%
mvs01
Contributor II
Contributor II
Author

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)