Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
patricesalem
Creator II
Creator II

count and if condition in expression for summary table (set analysis)

Hello 

I'm trying to find a solution to use count and if condition in an expression.

Here is the data sample:

patricesalem_0-1651067467165.png

 

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"

patricesalem_1-1651067672905.png

 

Any idea on how the expression to use ? 

I'm attaching a qvf file to run some test
Thanks
Patrice

 

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

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(<{

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
vinieme12
Champion III
Champion III

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')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
patricesalem
Creator II
Creator II
Author

@DataVizzPro -> thanks for the tip, it works perfect !

patricesalem
Creator II
Creator II
Author

@vinieme12 , thanks for your help !

unfortunatelly, the expression gives an error :

patricesalem_0-1651078579960.png

patricesalem_1-1651078626960.png

any idea - is the syntax wrong ?

 

vinieme12
Champion III
Champion III

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(<{

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
patricesalem
Creator II
Creator II
Author

it's working great !

thanks to both for your help

pat