NON RÉSOLU Comparison with NaN
-
Hello,
I created a calculated measure to see:
var x = selected month
var y = month -1if x >= y return 1
if x < y return -1but the issue is that I don't know how to get the result 0 if x == NaN or 0 or
y == NaN or 0 or
x == value and y == NaNplease see column Matrix 1.3
var x = <Selected Month(NO_AGG)>;
var y = <Month-1(NO_AGG)>;if(x < y ) {
return -1; //
} else if (x => y && x,y!=0 ) {
return 1; // ok
} else {
return 0 // code that will execute if all above conditions are false}
Thank you for your help,
-
Hello,
try this :var x = <Selected Month(NO_AGG)>; var y = <Month-1(NO_AGG)>; if(x < y ) { return -1; // } else if (x => y && x,y!=0 ) { return 1; // ok } else if (isNaN(x)) { return 0 }
-
Merci beaucoup pour votre aide, mais the result is not ok, returns -1, no change
-
Hi @madeleine ,
Have you tried :
var x = <Selected Month(NO_AGG)>; var y = <Month-1(NO_AGG)>; if(x < y ) { return -1; // } else if (x => y && x,y!=0 ) { return 1; // ok } else if (x == null || !x) { return 0 }