Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have a field called Abnormal which has the data 'H','L',' '
Now i want to drive a field called Normality based on the condition
1.if Abnormal is 'H','L' then the data should be 'Abnormal'
2.if Abnormal is ' ' then the data should be 'Normal'
Expected output:
Normailty
Abnormal
Normal
I used this if(subfield(Abnormal,',')='','Normal','Abnormal' ) as Normality but i am getting some null values also in Normality field.
Regards,
Joshua.
Hi,
PFA, script and app
NoConcatenate
FINAL:
Load
*,
if(len(subfield(Abnormal,','))=0 OR Abnormal='' , 'Normal','Abnormal' ) as NormalityF
Resident patient;
Drop Table patient;
FYR
my script
patient:
LOAD
BranchNo,
BranchName,
PatientType,
"Date",
SampleID,
Amount,
' ' as Abnormal,
' ' as BeyondTAT,
' ' as Normality,
Discount
Info:
BranchNo,
BranchName,
PatientType,
"Date",
SampleID,
' ' as Amount,
' ' as Discount,
' ' as BeyondTAT,
Abnormal,
if(subfield(Abnormal,',')='','Normal','Abnormal' ) as Normality
Tat:
BranchNo,
BranchName,
PatientType,
"Date",
SampleID,
' ' as Amount,
' ' as Discount,
' ' as Abnormal,
' ' as Normality,
BeyondTAT
Hi,
you can try this:
if(len(subfield(Abnormal,','))=0,Normal','Abnormal' ) as Normality
Regards,
Bhasker
Hi Joshua,
You can also try the below one:
IF([Abnormal]='H' AND [Abnormal]='L','Abnormal',Normal)
Thank you!
Best Regards,
Sumit K
Dear Bhasker,
I tried this but i am getting null values.
Dear Sumit,
I tried but i am getting null values.
can you share sample data?
Hi Joshua,
Try this =if(Len(Trim(fieldname))=0,'Normal','Abnormal')
Regards,
Sagar Puri.
Hi bhasker,
PFA for sample.
Hi,
I don't get it how subfield () useful over here..
did you try solution which given by sagar_puri
Regards,