
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sum with IF condition
Hi experts
I have the following issue:
Detecting the records with a time difference of less than 180 days:
if(interval([Termination Date]-[Contractual Start Date], 'd')<180, 1,0)
The above IF condition must be implemented in this SUM expression, any ideas?
sum(
{<[YearMonth]={"$(='>=' & Monthstart(Addmonths(Max(YearMonth),-11)) & '<=' & MonthEnd(Max(YearMonth)))"}>}
Joiner)
Many thanks, Tom
- Subscribe by Topic:
-
Chart
-
Client Managed
-
Developers
-
expression
-
filter
-
General Question
-
Set Analysis
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tom,
I have a personal rule that helps me a lot: if a Measure Expression looks too complex, maybe it is time to revisit your Load Script.
So, can you move the if(interval([Termination Date]-[Contractual Start Date], 'd')<180, 1,0) expression to your Load Script as a field - like [LessThan180Flag]? This will make your Measure way easier to do:
Sum({<[LessThan180Flag]={1}>} Joiner)
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tom,
I have a personal rule that helps me a lot: if a Measure Expression looks too complex, maybe it is time to revisit your Load Script.
So, can you move the if(interval([Termination Date]-[Contractual Start Date], 'd')<180, 1,0) expression to your Load Script as a field - like [LessThan180Flag]? This will make your Measure way easier to do:
Sum({<[LessThan180Flag]={1}>} Joiner)
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
