Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If feel like I'm missing something obvious...
I have 2 different dates in April 2019
What might be the reason that this returns TRUE: MonthEnd(Date1) = MonthEnd(Date2)
And this returns FALSE: InMonth(MonthEnd(Date1), MonthEnd(Date2), 0)
And in troubleshooting, I found that this returns TRUE: InMonth('04/30/2019', MonthEnd(Date2), 0)
And this returns FALSE: InMonth('04/30/2019', MonthEnd(Date1), 0)
InMonth wants a Timestamp as it's first argument. So with this as my script:
DATA2: LOAD Date(Date#(TestDateText1,'MM/DD/YYYY')) AS 'TestDate1', Date(Date#(TestDateText2,'MM/DD/YYYY')) AS 'TestDate2' ; LOAD * Inline [ TestDateText1, TestDateText2 '04/23/2019', '04/30/2019' ] ; EXIT Script ;
And this as my KPI formula,
InMonth(DayStart(MonthEnd(TestDate1)), MonthEnd(TestDate2), 0)
I get this:
So I think it's the Timestamp parameter that's causing you issues.
InMonth wants a Timestamp as it's first argument. So with this as my script:
DATA2: LOAD Date(Date#(TestDateText1,'MM/DD/YYYY')) AS 'TestDate1', Date(Date#(TestDateText2,'MM/DD/YYYY')) AS 'TestDate2' ; LOAD * Inline [ TestDateText1, TestDateText2 '04/23/2019', '04/30/2019' ] ; EXIT Script ;
And this as my KPI formula,
InMonth(DayStart(MonthEnd(TestDate1)), MonthEnd(TestDate2), 0)
I get this:
So I think it's the Timestamp parameter that's causing you issues.
May be issue with format of Date1?
Thank you. Date# on the Date1 field did the trick.