Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Set Analysis - date based on another date

Hello Experts,

I am building a Set Analysis based on two dates, Load Date and Inventory Date. The condition is that, if a Load Date for another falls on the same date of an inventory date, it should raise a flag, cause we avoid loading on inventory dates. 

I tried building a set analysis like below, however, it is not working. The set analysis I tried is below:

                      Count(distinct{<[Load Date]={"$(=Date([Work Date]))"}>}SALES_ID)

If I use the IF condition like below, how do I aggregate the count?

                       If([Load Date]=[Work Date],count(distinct SALES_ID))

Thanks,

Luiz

 

Labels (2)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

hi 

you can use 

   count( distinct If([Load Date]=[Work Date],SALES_ID))

by the way set analysis won't work , because it making selection in the app level ,

and not estimating conditions at row level

View solution in original post

3 Replies
Highlighted
Partner
Partner

hi 

you can use 

   count( distinct If([Load Date]=[Work Date],SALES_ID))

by the way set analysis won't work , because it making selection in the app level ,

and not estimating conditions at row level

View solution in original post

Highlighted
Creator II
Creator II

Hi Lironbaram,

This works. I knew it was a simple solution using IF, but I couldn't figure out the right place to use. Very good to know that it would not work with Set Analysis. So, Set Analysis never estimate conditions at row level?

Thanks,

Luiz

Highlighted
Partner
Partner

hi 

i am glad it helped you , 

regarding set analysis, set analysis allows you to replicate a selection action in the model just for the expression
and selections are an action at model level and not row level