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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to count expression with minus value?

Hi all,

I'm wondering how to count stores that i had with minus value, in this case my YTD Growth value, i use

Count(

{< vYTDamt = {'<0'} >} Distinct (Stores)

)

but i had that error in modifier expression, So anyone can help me? i attach an image for detail,

Thanks a lot,

Cheers,

31 Replies
Not applicable
Author

All,

Anybody know how to solve this issue?

vinafidalgo
Partner - Creator
Partner - Creator

I'm still trying when I have free time.

Can you upload the data sources?
I may need to reload the document for test purposes.

Not applicable
Author

Hi Ferdinand,

please see attached, correct total is 26 yes?

hope that helps

Joe

vinafidalgo
Partner - Creator
Partner - Creator

Ferdinand,

JosSimmons posted the correct solution.

Please check if it solve your problem.

Not applicable
Author

Works like a charm! cool! thanks a lot JoeSimmons

Not applicable
Author

Yes! its correct.. finally, thanks Vinicius

Not applicable
Author

Oh, btw.. what if i want to count the opposite value, positive value.. [YTD Growth] > 0 , i edit the script but its not that simple.. the total goes wrong..

Not applicable
Author

no problem glad to be of help.

To help explain it is basically using the boolean logic of your % calculation, which when you do Sum(exp)<0 returns you a 0 for false -1 for true.

By aggregating this by your customer field you effectively get a 0 or -1 for each customer.

Can then just sum that up and *-1 to flip the number

hope that makes sense

vinafidalgo
Partner - Creator
Partner - Creator

Please check if it's right

Not applicable
Author

Should be fine to just flip it to positive