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: 
pradeep92
Partner - Creator II
Partner - Creator II

Unable to write Set Analysis Expression for if condition

Hello,

Requirement:

Need to Create a table to count the IDs where the difference between Rolling date and Last updated date is between 0 to 6.

I have created a Table object with Dimension as RollingDate and measure as below and it works perfectly

count(distinct if((RollingDate-LAST_UPDATED_DATE<=6 and RollingDate-LAST_UPDATED_DATE>=0 ), ID))

 

But when I try to write with Set analysis, it shows 0 as measure with dimension RollingDate

Count({<RollingDate={"=RollingDate <= (LAST_UPDATED_DATE + 6)"}>}ID).

Kindly help me to create a table with dimension RollingDate and measure with Set analysis.

 

Thanks!

 

 

1 Reply
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

I would suggest you to create a flag in the script like below.

E.g if(RollingDate-LAST_UPDATED_DATE<=6 and RollingDate-LAST_UPDATED_DATE>=0,1,0 ) as Flag

 

And use that flag in Set Analysis.

Count(Distinct {<Flag = {'1'}>}ID)

 

Thanks,

Ashutosh