Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Set Analysis to count number of stores if a store is active (CA>0)

Hi folks,

As mentionned in the title, I want to be able to count how many active stores I have (with CA >0)

How to tell QlikView to count only those stores in a set analysis expression?

In sql it would be something like this :

select

Count(distinct stores)

from table

where CA >0

in a set expression, if i write sthing like this:

Count({<CA={'>=0'}>}stores) ; the CA will not be specific to store, it's about all the CA, find that it's >0 and thus the result won't be accurate since I will have all the stores returned even the inactive ones.

I tried with the aggr, and I still get wrong answers.

Anyone could help me please?

Thank you !

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Omar,

Try this:

COUNT({<stores = {"=Count(DISTINCT CA)>0"}>}Distinct stores)

Regards!

View solution in original post

8 Replies
Mark_Little
Luminary
Luminary

Hi,

I would normally do something like this in script and create a flag. Would be similar to what you have above.

Mark

MK_QSL
MVP
MVP

Can you provide 5-6 lines sample data to work?

Try

COUNT({<stores = {"=CA > 0"}>}Distinct stores)

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Try This,

COUNT({<CA={">0"}>} Distinct stores)

Muthukumar Pandiyan
Anonymous
Not applicable

Hi Omar,

Try this:

COUNT({<stores = {"=Count(DISTINCT CA)>0"}>}Distinct stores)

Regards!

Not applicable

Try this,

=COUNT({<CA -={0}>} DISTINCT stores)

aapurva09
Creator
Creator

Hi,

Count(Distinct {<CA={">0"}>} Stores). If this doesn't work. Share the data to check the relation between stores and CA.

Thanks.

OmarBenSalem
Author

Yes, that's it; thank you all

Anonymous
Not applicable

You're wellcome!