Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have the following conditionals on my script to mark with a flag if I have an anomaly or not:
IF (FLAG_ANOMALY = 1, 'With Anomaly',
IF (FLAG_ANOMALY = 0 AND FLAG_INSPECTION = 1, 'No Anomaly',
'Pending')) AS FLAG_ANOMALY_TYPE
The thing is that I get some rows with null and I want that everything that is not 'With Anomaly' / 'No Anomaly' get the value 'Pending'.
What could it be?
Thank you!!!
IF (FLAG_ANOMALY = 0 AND FLAG_INSPECTION=1,'No Anomaly',IF(FLAG_ANOMALY=1,'With Anomaly','Pending'))
The other thing is if you are adding new fields after your initial calculation i.e. concatenating new rows of data and you haven't included your if statement
I assume that there are records where FLAG_ANOMALY is not 1 neither 0. How do you want to handle this?
In the Script use
NullAsValue Flag_Anomaly ;
Set NullValue = 'Pending';
Regards
But I previously have a table in my script where I do the following:
IF (NOT ISNULL (ANOMALY_TYPE), 1, 0) AS FLAG_ANOMALY,
IF (NOT ISNULL (INSPECTION_TYPE), 1, 0) AS FLAG_INSPECTION
So I suppose I should assign a value for every type of anomaly...
If not, I'd like to put 'Pending' for the remaining records.
In this case the response from Felim Shanaghy is what you need.
Okay, I'm going to try it. Thank you!