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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Set analysis and operator

Hi all,

In a straight table, I have customer as dimension, and in expression I want to count how many weeks that a customer has participated on both Tuesday and Friday in any given week. I'm using this set analysis

=count({<WeekStart=p({<WeekDay={'Fri'}>})*p({<WeekDay={'Tue'}>})>}distinct WeekStart)

Is there something wrong with this set analysis? Because it's showing an incorrect number.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You would need to bring in the customer in your set expression.

Create a key in your data model that is made of CustomerID and Weekstart, CustomerIDWeekstart.

=count({<CustomerIDWeekstart = p({<WeekDay={'Fri'}>})*p({<WeekDay={'Tue'}>})>} distinct CustomerIDWeekstart)



View solution in original post

3 Replies
Kushal_Chawda

seems correct to me, try below

count({<WeekDay={'Fri'}>*<WeekDay={'Tue'}>} distinct WeekStart)

swuehl
MVP
MVP

You would need to bring in the customer in your set expression.

Create a key in your data model that is made of CustomerID and Weekstart, CustomerIDWeekstart.

=count({<CustomerIDWeekstart = p({<WeekDay={'Fri'}>})*p({<WeekDay={'Tue'}>})>} distinct CustomerIDWeekstart)



Anonymous
Not applicable

Hi Sifat, try this

=count({<WeekStart=p({<WeekDay={'Fri'}*{'Tue'}>})>}distinct WeekStart)

Regards