Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have little transformation on my app very simple which works againg Home_Flag = 1 or 0 (numeric) and I noticed that it works strangely if I use this expression:
if(Home_Flag = 0,'No','Yes') putting Yes for some data where Home_Flag = 0
it happening while working on big dataset (500K+ rows).
I fixed this by using:
if(Home_Flag > 0,'Yes','No')
Not sure what is wrong with first one, I DID played with quotes around "0" and it doesn't make any diff. I used it to add column in my simple table in Q Sense.
Thanks
M
I think that is because when you write equal to 0 it looks for exact zero. If there is any decinal value like 0.0000002 it will go to else condition. It is always better to use >=0 if you are looking for positive value or with >0 and < 2 something like that so that it will take care of decimal values.
I think that is because when you write equal to 0 it looks for exact zero. If there is any decinal value like 0.0000002 it will go to else condition. It is always better to use >=0 if you are looking for positive value or with >0 and < 2 something like that so that it will take care of decimal values.
May be your home_flag what some values like 0.000XXX which is not exactly zero, that is why it works with > operator.
I agree - it seems likely that your zero is not exactly zero (even though it may display as 0). You could also try
=If(Round(Home_Flag) = 0, 'No', 'Yes')
Thanks Jaydeep, Lakshmikandh and Jonathan, I'm doing more work to clarify this, still have itching about this, alas can't give stars to all you..
Best
M
I did more testing and see that it's indeed 0 or 1, this load doesn't brings any rows, so it might be something else including my errors.
LOAD
.....
WHERE FLAG <> 1 and FLAG <> 0