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: 
James_Brems
Contributor
Contributor

set expression based on calculation

Hi everyone,

i would like to have a chart that displays the number of customers by Customer Type that had more than X orders in a certain time period (depending on selections). 

But the number of orders has to be calculated by a count of order IDs. 

data is structured like this:

Customer_ID, Customer_Type, Order_ID, Product_ID, order_date, ...

 

the chart should have Customer Type as a dimension, 

the logic in the formula should be something like this 

= count (disctinct Customer_ID) but only for Customers where count (disctinct Order_ID) > 3

Customer IDs should not be in the chart/Table. 

any ideas how to do that?

 

thanks a lot for your help!

3 Replies
Gysbert_Wassenaar

= count ({<Customer_ID={"=count (distinct Order_ID) > 3"}>}distinct Customer_ID) 


talk is cheap, supply exceeds demand
James_Brems
Contributor
Contributor
Author

thanks for the answer, but that does not work. 

what would a function like 

"=count (distinct Order_ID) > 3" 

actually return?

Gysbert_Wassenaar

0 or -1 depending on if the count of distinct order id's is larger than 3 or not.


talk is cheap, supply exceeds demand