Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have an if statement inside my sum function that is giving wrong result. For example
sum( if(year(IncidentDate)>= year(MaxIncindentDate) - 2,calltime)) is giving me 515224 while sum(calltime) is giving me 357.7951 value
Please note that the condition inside if statement is supposed to fetch all data as I only have past two years data at the moment and the if statement means to fetch data for last three years including current year. Therefore, logically both statements should give same result. I believe that 357.7951 is the correct value though
Can someone please help me understand the difference here
Arif
I suppose that IncidentDate, MaxIncidentDate and calltime are not in the same table?
IncidentDate and Calltime are in same table. MaxIncidentDate is a variable i created in load script.
If I had to write the same statement in a set analysis, how will the statement look like?
Arif
Something like:
=sum({<IncidentDate={">=$(=YearStart(AddYears(MaxIncidentDate, -2)))"}>} calltime)
OK the set analsysi expression is also giving 515224. Then I tried sum( if(1,calltime)) and it is also giving 515224 value. sum(calltime) is giving 357.7951 value though
Not sure whats happening here
Arif
There's something wrong with your data structure. You must post an example so we can stop guessing.