Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mv
Contributor
Contributor

another variable in selection

Hi 

I have data: 

stores: logo, name, limit_from, limit_to 

orders: logo, client_id, value, order_id

I need to calculate to each store orders with the value between limit_from and limit_to (different for stores). 

I have an expression: 

 

count({<value={">$(limit_from)"},value={"<$(limit_to )"}}distinct order_id)

 

but it is true for every row, I have the same answer like expression count(distinct order_id)

Thanks for Your help. 

 

 

 

2 Solutions

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:
count( distinct if( value > limit_from and value < limit_to, order_id ) )

View solution in original post

bharatchauhan
Contributor II
Contributor II

Try this expression:

AGGR(COUNT({<value={">$(limit_from) < $(limit_to )"}>}DISTINCT order_id),name)

Hope this might help you!

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:
count( distinct if( value > limit_from and value < limit_to, order_id ) )
bharatchauhan
Contributor II
Contributor II

Try this expression:

AGGR(COUNT({<value={">$(limit_from) < $(limit_to )"}>}DISTINCT order_id),name)

Hope this might help you!

mv
Contributor
Contributor
Author

So simple and it works!

thanks! m.