Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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. 

 

 

 

Labels (1)
2 Solutions

Accepted Solutions
agigliotti
MVP
MVP

maybe this:
count( distinct if( value > limit_from and value < limit_to, order_id ) )
The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

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
MVP
MVP

maybe this:
count( distinct if( value > limit_from and value < limit_to, order_id ) )
The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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.