Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I'm trying to find a solution to use count and if condition in an expression.
Here is the data sample:
I would like to display a summary table that shows per plant :
- the number of orders : count (distinct order_number)
- the number of orders where all lines are ready to ship (if at least 1 line of the order is not ready to ship then the full order is not ready to ship)
=> on order 2275393 : 3 unique_id / 3 lines, only 2 are ready to ship, so this order is not ready to ship.
I don't manage to find the correct expression...
=> on order 2275394 : the 3 lines are ready to ship, so the order is "ready to ship"
Any idea on how the expression to use ?
I'm attaching a qvf file to run some test
Thanks
Patrice
Apologies, there was a typo here, corrected now
=if(count({<order_number=e({<Ready_to_ship={'0'}>}order_number)>}Distinct order_number),'Ready To Ship','Not Ready')
It should be e({< and not e(<{
Exclude Order_number which has 0 in ready_to_ship as below
=count({<order_number=e(<{Ready_to_ship={'0'}>}order_number)>}Distinct order_number)
or for text value
=if(count({<order_number=e(<{Ready_to_ship={'0'}>}order_number)>}Distinct order_number),'Ready To Ship','Not Ready')
@DataVizzPro -> thanks for the tip, it works perfect !
@vinieme12 , thanks for your help !
unfortunatelly, the expression gives an error :
any idea - is the syntax wrong ?
Apologies, there was a typo here, corrected now
=if(count({<order_number=e({<Ready_to_ship={'0'}>}order_number)>}Distinct order_number),'Ready To Ship','Not Ready')
It should be e({< and not e(<{
it's working great !
thanks to both for your help
pat