Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate % of Total Expression

I have a straight table, with Customer dimension and Sum(Sales) as expression.

I want another Expression that should show me that Customer sales as a % of Total Sales. I am unable to figure out how to do that. Any help is appreciated.

CustomerSales% Sales
A1010%
B2020%
C3030%
D4040%
Total100

Thanks,
Sagar

10 Replies
kangaroomac
Partner - Creator II
Partner - Creator II

Hi Sagar,

I'm not quite sure I'm following what you would like to do, but I have made some assumptions and a possible solution for you could be to :

  • Create a field for your sales in the load script (i.e. Region based or whatever your source looks like)
    • In the attached example I called it Negative_Sales
    • When you use the Total keyword now, it is only the total of the total you are after
  • Then on the front end I changed the expression to be the one created in the load script
  • I also put in a logic field, that tests whether it is larger than or equal to the variable connected to the slider
    • In this example just toggles between Yes and No, depending on the slider, but in real world, an option could be to show a dimension based on the selection and then choosing suppress when nulll

Hope this helps.