Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
datashaw
Contributor III
Contributor III

Set analysis - Percentage Count

Please shed some light on below expression I’m trying to show the count of percentages only  if the percentage is < 50%

  My expression is =Count({<Status-={'REJECTED'},Code ={'AP'} Items) / Count ({<Status-={'REJECTED'}>}Items)
The above expression gives me 40%  so my count is 1.

My Dimension= Date, Product
Expression is Count of  items if the above expression is <50% Items)

 

Expected Result:

Straight table

Date            Provider   Count of Expression(only <50%)

28/04/2019    002        1

27/04/2019    019        5

Please suggest a solution for the above. appreciate your help in advance!

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

So, for the sample data provided... this gives me 2

Sum(Aggr(

If(Count({<Code = {'AP'},ResponseTime = {">=00:30:00<=10:00:00"}>}Items)/Count({<Code = {'AP'}>}Items) < 0.50, 1, 0)

, Date, Provider))


Expression is different because the chart dimensions are different.... this expression is based on Provider being the second dimension....

View solution in original post

8 Replies
sunny_talwar

May be this

Sum(Aggr(

If(Count({<Status-={'REJECTED'},Code ={'AP'} Items) / Count ({<Status-={'REJECTED'}>}Items) < 0.50, 1, 0)

, Date, Item))

datashaw
Contributor III
Contributor III
Author

Hi Sunny, Sorry for the delay reply. I am getting the output of '0' normally i would expect numbers. is that something issue with my dimensions, (Date, Provider)..? on the above expression
sunny_talwar

Would you be able to share some sample data?

datashaw
Contributor III
Contributor III
Author

I'm working on Hub, not sure how to share he qvf file. But i am sharing some sample data with the straight table screenshot Here : Straight table

Dimentions are Date, Provider

Expression: Count({< code={'AP'},ResponseTime={'>=00:30:00<=10:00:00'}>}Items)/Count({< code={'AP'}>}Items)

Want to show another expression would be count of any percentage which is <50 %

my dummy data shows 0% and 100% only. basically in this case i want to show the count of 0%'s because 0% is <50. please do me know if its clear.? 

sunny_talwar

So, in this case, you would want a count of 2?

image.png

datashaw
Contributor III
Contributor III
Author

Yes Exactly..thats right I am looking to see the Count of 2, but your previous expression giving me '0' please suggest me the solution.

sunny_talwar

So, for the sample data provided... this gives me 2

Sum(Aggr(

If(Count({<Code = {'AP'},ResponseTime = {">=00:30:00<=10:00:00"}>}Items)/Count({<Code = {'AP'}>}Items) < 0.50, 1, 0)

, Date, Provider))


Expression is different because the chart dimensions are different.... this expression is based on Provider being the second dimension....

datashaw
Contributor III
Contributor III
Author

you are star. thanks for the help. much appreciated.