Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
riishabhz
Creator
Creator

count of 0 in expression

discountvalue.PNG

this is discount1 and its expression is 

=Sum({<SalesDate={'>=$(=Date(start))<=$(=Date(end))'}>}((InvoiceQuantity)*Replace(ETPMRP,'-','')-(RealisedSale)))

total count of this column is 119 which is billno.

every billno has certain values .

i want to show this 119 in pie chart with count of zero values .

for example here 119 rows are displayed and out 119 rows there are 30 zero values which i have marked in pic.

so i want to show value of 119 and total count of zero values  in pie chart  like this .

1 Solution

Accepted Solutions
tresesco
MVP
MVP

In your sample app discount1 is a field, whereas, in your actual app it is perhaps an expression. So giving solution against your sample might not help you exactly. However, it might help you understand the approach. You could try like:

Capture.PNG

To handle the scenario of an expression, you could try something like:

Count({<BillNo={"=YourExpression=0"}>}BillNo)

View solution in original post

6 Replies
tresesco
MVP
MVP

Could you share your sample app?

riishabhz
Creator
Creator
Author

i have attached please see

Brett_Bleess
Former Employee
Former Employee

Rishabh, one way to this is in the load script which would be to use a 'flag' field and set the flag value to 1 if the discount1 value is 0, else everything else gets a 0 value, and then you simply sum the flag field to get your count of 0 values on discount1.  Hopefully this makes sense, if you add this to the script, may do what you are looking for in this use case.

I am sure set analysis may allow you to do this too, but I am not so good with that area, so I am adding a link for you below on that from the Design Blog area:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
tresesco
MVP
MVP

In your sample app discount1 is a field, whereas, in your actual app it is perhaps an expression. So giving solution against your sample might not help you exactly. However, it might help you understand the approach. You could try like:

Capture.PNG

To handle the scenario of an expression, you could try something like:

Count({<BillNo={"=YourExpression=0"}>}BillNo)

riishabhz
Creator
Creator
Author

thank you sir , your solution is working perfectly.

riishabhz
Creator
Creator
Author

ok sir will try