Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Partition By in Measure Expression / And Filter Operation within an Attribute

Hi,

We have a unique requirement, following is an example table

Subscriber, Persona

1,Foodie

1,Fashion Savvy

1,Traveler

2,Foodie

2,Sociable

2,Sports Enthusiast.

We have other tables as well and the only measure we use is Count(Distinct Subscribers).

The requirement is that when user selects two persona, only subscribers belonging to both of these personas should be considered. i.e. if the user selects Persona = 'Foodie' & 'Traveler' then from the above example only subscriber '1' should be considered in Count(Distinct Subscribers) rather than both 1 & 2.

Currently what happens is that both 1 & 2 will be considered because both of them have Foodie. But only one have Traveler. 

The number of selections can be upto 100 so we can't have them in different columns. It has to be in the same column.

 

What I need is something like this

if  Total Count(Distinct Persona) = Count(Distinct Persona) over (partition by Subscriber)

then Subscriber

else null().

1 Solution

Accepted Solutions
Highlighted

May be this

Count(DISTINCT {<Subscriber = {"=Count(DISTINCT Persona) = GetSelectedCount(Persona)"}>} Subscriber)

View solution in original post

3 Replies
Highlighted
Creator III
Creator III

Hi !

Maybe count(distinct {<Persona={"=Count(distinct Subscriber)=$(=count(distinct Subscriber))"}>} Persona)

Highlighted

May be this

Count(DISTINCT {<Subscriber = {"=Count(DISTINCT Persona) = GetSelectedCount(Persona)"}>} Subscriber)

View solution in original post

Highlighted
Partner
Partner

It worked. Thanks 🙂