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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable in Set Analysis

Good morning,

I am trying to do a set analysis calculation, and i'm running into some trouble.

This one seems to work:

count( {$< CustomerSales = {"<=$(#vTier1)"} >}  DISTINCT [WH Customer])

But when i add a second variable in there, to say greater than tier 1 but less than tier 2, it doesn't work.

count( {$< CustomerSales = {">$(#vTier1)"}, CustomerSales = {"<=$(#vTier2)"}>}  DISTINCT [WH Customer])

Not sure why this one doesnt work...


Much thanks,

-David

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try it like this: count( {$< CustomerSales = {">$(#vTier1)<=$(#vTier2)"}>}  DISTINCT [WH Customer])


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Not applicable
Author

I'm trying to count the distinct customers whose sales are greater than Variable vTier1 but less than Variable vTier2

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try it like this: count( {$< CustomerSales = {">$(#vTier1)<=$(#vTier2)"}>}  DISTINCT [WH Customer])


talk is cheap, supply exceeds demand
Not applicable
Author

Great! This works!

Is my method a possible way to do this as well?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Nope. Well, you could do it like this:

count( {$< CustomerSales = {">$(#vTier1)"}> * <CustomerSales = {"<=$(#vTier2)"}>}  DISTINCT [WH Customer])

But it is less clear imho and could perform worse too since first two sets are calculated and then intersected with each other.


talk is cheap, supply exceeds demand
Not applicable
Author

Much Much appreciated!