Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a variable (vGoal) and it has 80 as both the definition and the value.
I have a master measure called MM.
I am using this If statement:
If (MM <= vGoal, 'Good', 'Bad')
The problem is that when MM is 80, it should be 'Good', but it is showing me 'Bad'.
I think the problem lies with the equal sign. It won't work when I do this:
If (MM = vGoal, 'Equal')
It only works when I do this:
If ( MM < 80.5 AND MM > 79.5, 'Equal')
I can't think of anything I might be doing wrong. Thank you for your help.
It doesn't work. There is no output after I used your If statement.
I ended up using this If statement:
If ( MM < (vGoal+0.5) AND MM > (vGoal-0.5), 'Good',
If (MM > vGoal, 'Bad', 'Good')).
Just try this
If (Num(MM) = Num(vGoal), 'Good', 'Bad')
I think MM hasn't really the value of 80 even if it looked like that else it's probably something like 80.00000000001.
This means some kind of rounding will be needed or maybe another kind of the query, for example something like:
pick(sign(MM - vGoal) + 2, 'Good', 'Good', 'Bad')
It doesn't work. There is no output after I used your If statement.
I ended up using this If statement:
If ( MM < (vGoal+0.5) AND MM > (vGoal-0.5), 'Good',
If (MM > vGoal, 'Bad', 'Good')).
Your formula is still giving me Bad at 80. I ended up using this If statement:
If ( MM < (vGoal+0.5) AND MM > (vGoal-0.5), 'Good',
If (MM > vGoal, 'Bad', 'Good')).