Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

3 Replies
marcus_sommer

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

Try this

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