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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression %

Hi,

I wonder if you can help me I have a Chart that I'm currently running this expression on:

=count ({<[OC] = {'C'}>} Distinct Order)

this is counting the orders that only have the OC field set to C

what I'm trying to achieve is  this but then divide it by total orders to work out the % of orders going via this method if that makes sense

so for instance when I select a customers name it shows me 30% of there orders when via Method C

in SQL you would do a simple Count Orders / Orders where OC = C

Thanks

Labels (1)
3 Replies
marcus_sommer
MVP
MVP

I'm not sure if I understand your question right but try this:

=count ({<[OC] = {'C'}>} Distinct Order) / count ({<[OC] = {'C'}>} Distinct TOTAL Order)

- Marcus

Anonymous
Not applicable
Author

HI,

WHat are you exactly triying to do?

If you need to check the % of OC=C orders compare to total orders, try this:

=count ({<[OC] = {'C'}>} Distinct Order)/count (Distinct Order)*100

If you need to check the % of OC=C orders of a given client compare to total OC=C orders, try this:

=count ({<[OC] = {'C'}>} Distinct Order)/count ({<[OC] = {'C'}>}TOTAL Distinct Order)*100

Colin-Albert
Partner - Champion
Partner - Champion

Try this

     count ({<[OC] = {'C'}>} Distinct Order) / count (Distinct TOTAL Order)