Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ellenblackwell
Partner - Contributor III
Partner - Contributor III

Not IsNull() and Diff between Dates in Set Analysis

I should know this in my sleep. Problem is, I should be asleep, so I'm really struggling. Would appreciate any assistance! I need to translate this expression into set analysis:

If(not isnull([Date_Field1]) and ([Date_Field1]>[Date_Field2]), Sum([Sales])

Basically, I'm summing a value only where two date fields are both populated and one of the dates is greater than the other.

And one more example:

If(Today()-[Date_Field1]<=10, Sum([Sales])

Many thanks!

2 Replies
sushil353
Master II
Master II

Hi

I am assuming you have a dimension in your chart say Dim1

then try this expression:

sum({<Date_Field1 -= {' '}>*<Dim1 = {"[Date_Field1]>[Date_Field2]"}>}[Sales])

HTH

Sushil

sunny_talwar

Why don't you create a flag in the script like this

If(Len(Trim(Date_Field1)) > 0 and Date_Field1 > DateField2, 1, 0) as Flag

and then this

Sum({<Flag = {'1'}>}Sales)