Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
luizcdepaula
Creator III
Creator III

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
lironbaram
Partner - Master III
Partner - Master III

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
lironbaram
Partner - Master III
Partner - Master III

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

luizcdepaula
Creator III
Creator III
Author

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

lironbaram
Partner - Master III
Partner - Master III

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