I am using the if else statement as below in my query
|> map(
fn: (r) => ({r with
level: if r._value >= 0 and r._value <= 1 then
“Profit”
else
“Loss”,
}),
)
My question is I think it is not working correctly as it is showing profit when the value is 20 for one of the date. Actually it must show loss. Is this right or wrong.
Hello @AVVS_Sudheer,
Hmm that’s very odd.
Can you share the full query and the erroneous output?
I’ve never experienced that type of error before.
What version are you using? Can you upgrade maybe?