Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ajsjoshua
Specialist
Specialist

Filter pane dimension

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.

1 Solution

Accepted Solutions
bhaskar_sm
Partner - Creator III
Partner - Creator III

Hi,

PFA, script and app

NoConcatenate

FINAL:

Load

*,

if(len(subfield(Abnormal,','))=0 OR Abnormal='' , 'Normal','Abnormal' ) as NormalityF

Resident patient;

Drop Table patient;

View solution in original post

14 Replies
ajsjoshua
Specialist
Specialist
Author

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

bhaskar_sm
Partner - Creator III
Partner - Creator III

Hi,

you can try this:

if(len(subfield(Abnormal,','))=0,Normal','Abnormal' ) as Normality


Regards,

Bhasker

Anonymous
Not applicable

Hi Joshua,

You can also try the below one:

IF([Abnormal]='H' AND [Abnormal]='L','Abnormal',Normal)

Thank you!

Best Regards,

Sumit K

ajsjoshua
Specialist
Specialist
Author

Dear Bhasker,

I  tried this but i am getting null values.

ajsjoshua
Specialist
Specialist
Author

Dear Sumit,

I tried but i am getting null values.

bhaskar_sm
Partner - Creator III
Partner - Creator III

can you share sample data?

sagar_puri
Partner - Contributor III
Partner - Contributor III

Hi Joshua,

Try this =if(Len(Trim(fieldname))=0,'Normal','Abnormal')

Regards,

Sagar Puri.

ajsjoshua
Specialist
Specialist
Author

Hi bhasker,

PFA for sample.

big_dreams
Creator III
Creator III

Hi,

I don't get it how subfield () useful over here..

did you try solution which given by sagar_puri

Regards,