Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ajsjoshua
Contributor III

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.

Tags (1)
1 Solution

Accepted Solutions
bhasker_smu
Contributor II

Re: Filter pane dimension

Hi,

PFA, script and app

NoConcatenate

FINAL:

Load

*,

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

Resident patient;

Drop Table patient;

14 Replies
ajsjoshua
Contributor III

Re: Filter pane dimension

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

bhasker_smu
Contributor II

Re: Filter pane dimension

Hi,

you can try this:

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


Regards,

Bhasker

sumitkulkarni
New Contributor III

Re: Filter pane dimension

Hi Joshua,

You can also try the below one:

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

Thank you!

Best Regards,

Sumit K

ajsjoshua
Contributor III

Re: Filter pane dimension

Dear Bhasker,

I  tried this but i am getting null values.

ajsjoshua
Contributor III

Re: Filter pane dimension

Dear Sumit,

I tried but i am getting null values.

bhasker_smu
Contributor II

Re: Filter pane dimension

can you share sample data?

sagar_puri
New Contributor III

Re: Filter pane dimension

Hi Joshua,

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

Regards,

Sagar Puri.

ajsjoshua
Contributor III

Re: Filter pane dimension

Hi bhasker,

PFA for sample.

big_dreams
Contributor III

Re: Filter pane dimension

Hi,

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

did you try solution which given by sagar_puri

Regards,

Community Browser