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: 
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 (1)
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.