Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
AB108
Contributor III
Contributor III

Create a % contribution variable

Hi,

Attaching sample data.

If you look at the Pivot table, I want to create "% Contribution in Sales" as a variable. This should be dynamic based on the selections of year, prod, month. 

I want to use this variable as part of expressions in other charts.

I tried a few expressions  but its not working

Thanks for your help.

 

 

 

Labels (1)
3 Replies
E_Røse
Creator II
Creator II

Try 

=Sum(total {<Region={'p'}>}[Sales])/Sum(total [Sales])

AB108
Contributor III
Contributor III
Author

@E_Røse 

Thanks for the response.  What I am looking for is to get it dynamically for different regions.

 

E_Røse
Creator II
Creator II

@AB108, it is dynamic, so can you be more specific? 

I if you add the expression I wrote before, to the variable editor, 

ElinRse_0-1675723486623.png
this is what you get:

ElinRse_1-1675723552432.pngElinRse_2-1675723586408.png

If you want it for all regions in the same variable, you could do like this:

ElinRse_3-1675724943914.png

 

ElinRse_2-1675724913231.png