Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My substraction returns the wrong values . First orderintake culumn shows a (correct) measure and the second shows the script.
I use this script and tried al kinds of code to make it work, but it keeps returning the wrong values. Does anyone have an idea why this goes wrong?
I use this script code:
if(isnull([vorigemaandContractwaardemaandelijks]),[Contractwaardemaandelijks],[Contractwaardemaandelijks]-[vorigemaandContractwaardemaandelijks]) AS Orderintake_Period
Simply put:
if(isnull(LASTMONTH), MONTH, MONTH - LASTMONTH) AS Orderintake_Period
LastMonth looks to be zero, not null?
Correct, and then it should substract 'MONTH - LASTMONTH'. It should return: -5696-0 = -5696. However it does return a 0. I'm clueless as to why.
No idea what the actual underlying data is, so I couldn't begin to guess. I suggest breaking it down into two fields, one which returns Month and the other which returns lastmonth (but otherwise with the exact same formula), which should pinpoint where the issue is, and work from there.