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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Jason_Michaelides
Partner - Master II
Partner - Master II

Boolean Functions in Set Analysis?

Hi all,

I have the following expression in a pivot table:

=SUM(IF(InMonthToDate(Date,Today()-1,0) AND [Calc Ad?]='YES',Impressions))


To improve efficiency I want to convert this to a Set Analysis expression but can't see how. Any ideas?

Thanks,

Jason

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If Date (or Month, or anything Date-related) needs to be one of your Chart Dimensions, than you can't use Set Analysis - because Set Analysis is only calculated once for the whole chart.

Also, I'd recommend to simplify the condition InMonthToDate() and pre-calculate a flag in your load script: MTDFlag=1 for all dates in your calendar that satisfy this condition.

Then, if your chart doesn't have a date as a dimension, you can do something liket his:

sum({<MTDFlag={1], [Calc Ad?]={'YES'} >} Impressions)

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

If Date (or Month, or anything Date-related) needs to be one of your Chart Dimensions, than you can't use Set Analysis - because Set Analysis is only calculated once for the whole chart.

Also, I'd recommend to simplify the condition InMonthToDate() and pre-calculate a flag in your load script: MTDFlag=1 for all dates in your calendar that satisfy this condition.

Then, if your chart doesn't have a date as a dimension, you can do something liket his:

sum({<MTDFlag={1], [Calc Ad?]={'YES'} >} Impressions)

Jason_Michaelides
Partner - Master II
Partner - Master II
Author

Many thanks Oleg.