Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
JJ141
Contributor II
Contributor II

Counting expression in pie chart

Hi,

Hope your day is going well.

I am currently trying to create a pie chart which shows the count of y/n. The y/n column is made from the expression below:

If(
fabs(
([Forecast Status] - (sum([Quantity Delivered_forecast]) / 3))
/
(
([Forecast Status] + (sum([Quantity Delivered_forecast]) / 3)) / 2
)
* 100
) > 20, 'Y', 'N')

JJ141_0-1618182572055.png

 

Any help would be much appreciated. 🙂

 

Thanks 

 

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

Hi @JJ141 

Try like below

Count of "Y":

Sum(If(
fabs(
([Forecast Status] - (sum([Quantity Delivered_forecast]) / 3))
/
(
([Forecast Status] + (sum([Quantity Delivered_forecast]) / 3)) / 2
)
* 100
) > 20, 1))

Count of N:

Sum(If(
fabs(
([Forecast Status] - (sum([Quantity Delivered_forecast]) / 3))
/
(
([Forecast Status] + (sum([Quantity Delivered_forecast]) / 3)) / 2
)
* 100
) <= 20, 1))

Or,

Try to bring the flag in Script

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

Hi @JJ141 

Try like below

Count of "Y":

Sum(If(
fabs(
([Forecast Status] - (sum([Quantity Delivered_forecast]) / 3))
/
(
([Forecast Status] + (sum([Quantity Delivered_forecast]) / 3)) / 2
)
* 100
) > 20, 1))

Count of N:

Sum(If(
fabs(
([Forecast Status] - (sum([Quantity Delivered_forecast]) / 3))
/
(
([Forecast Status] + (sum([Quantity Delivered_forecast]) / 3)) / 2
)
* 100
) <= 20, 1))

Or,

Try to bring the flag in Script

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
JJ141
Contributor II
Contributor II
Author

Thanks @MayilVahanan it worked!

 

MayilVahanan

Hi @JJ141 

If its satisfied your requirement, could you please close this thread

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.