zedleb
August 11, 2020, 7:45am
1
Hi all
I’m learning to use if else
in Column Expressions and have noticed some behaviour that I don’t understand…
Here I use the format if() true, false
and get the result 0.1336 on the first row
Here I use the format if() x else x
and get the result 0.0
The correct result should be 0.1336 as the “Secteur” is not “MOULAGE”.
But most of the references to if else
I see use the second format.
It seems that the problem is with my condition as I get the same results even when I put the ‘correct’ “Secteur”.
But if I use the second format (with else
) I always get the false result and if I use the comma I always get the true result.
Or are these reversed somehow in the two statements??
Can anyone see where I’m going wrong?
Much appreciated.
Zx
1 Like
zedleb
August 11, 2020, 8:35am
2
OK I’ve resolved the condition by using @izaychik63 suggestion
So now I can test the outcomes and yes if I use the else
I have the correct result but if I use the comma I have a reversed result.
I don’t know now where I saw the statement using a comma - but I won’t be using it now!
2 Likes
ipazin
August 11, 2020, 1:14pm
3
Hi @zedleb ,
glad you figured it out. I usually check this page when using Column Expressions
https://www.w3schools.com/js/js_if_else.asp
Br,
Ivan
3 Likes
zedleb
August 12, 2020, 7:55am
4
Thanks @ipazin
I’m not at all familiar with JavaScript but I think I need to get into it to be able to use snippets etc. The w3schools was on my list for tutorials
2 Likes
system
Closed
February 10, 2021, 7:55pm
5
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.