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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
davyqliks
Specialist
Specialist

using an if(SUM) calculation as a dimension in a pie chart

Hi Experts,

im hoping you can help, i have the below working in the front end model to give the right values but i cannot get this into my load script so wondering if it is possible to use the following in any way as a dimension of a pie chart:

or ideally have this as the measure with no dimension, is it possible?

 

=if(
Sum(
{<[We Care Materials] = {'Sustainable'}>}
([Garment average net weight (gram)] * [Weight Ratio] )/100 * Percentage / 100 ) / 2
/
[Garment average net weight (gram)] * 100
>=50, 'Sustainable','Not Sustainable')

Thanks 

Daniel

 

Labels (2)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

What is your dimension(s) in your front-end table that you used, or want this to be related to in your pie chart.

your pie chart can use a calculated dimension.  

=aggr(if(
Sum(
{<[We Care Materials] = {'Sustainable'}>}
([Garment average net weight (gram)] * [Weight Ratio] )/100 * Percentage / 100 ) / 2
/
[Garment average net weight (gram)] * 100
>=50, 'Sustainable','Not Sustainable'), <field1>, <field2>)

View solution in original post

3 Replies
stevejoyce
Specialist II
Specialist II

What is your dimension(s) in your front-end table that you used, or want this to be related to in your pie chart.

your pie chart can use a calculated dimension.  

=aggr(if(
Sum(
{<[We Care Materials] = {'Sustainable'}>}
([Garment average net weight (gram)] * [Weight Ratio] )/100 * Percentage / 100 ) / 2
/
[Garment average net weight (gram)] * 100
>=50, 'Sustainable','Not Sustainable'), <field1>, <field2>)

davyqliks
Specialist
Specialist
Author

Thank for the reply,

I need the dimension to show Sustainable / Not Sustainable. this is base on the answer of the if(SUM) above.

So should  <field1>, <field2>  be the  group by values to Aggregate by? or the fields i want as the dimension values.

Thanks and apologies, i really wanted this in the load so could be used as a dimension but joining the tables and the group by is giving me a headache, wanted to try a different approach.

thanks

Daniel

davyqliks
Specialist
Specialist
Author

Hi,

Got this working with one Aggr of the main order filter,

thanks so much for your help

Daniel