Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
kavita25
Not applicable

How to write if condition to get all values in the script...

Hi Everyone,

I want to write an if condition as below:

For e.g

Fieldname

1

2

3

4

5

if(Fieldname = '1','A',

if(Fieldname <> '1','B',

if(Fieldname = 'ALL','C',

)

ALL is whole value in the field.

Please help me with this issue...

Regards,

Kavita

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: How to write if condition to get all values in the script...

May be create a link table:

LinkTable:

LOAD DISTINCT FieldName,

          'A' as Flag

Resident Fact

Where Fieldname = 1;

Concatenate (LinkTable)

LOAD DISTINCT FieldName,

          'B' as Flag

Resident Fact

Where Fieldname <> 1;

Concatenate (LinkTable)

LOAD DISTINCT FieldName,

          'C' as Flag

Resident Fact;

4 Replies
sunny_talwar
Not applicable

Re: How to write if condition to get all values in the script...

May be create a link table:

LinkTable:

LOAD DISTINCT FieldName,

          'A' as Flag

Resident Fact

Where Fieldname = 1;

Concatenate (LinkTable)

LOAD DISTINCT FieldName,

          'B' as Flag

Resident Fact

Where Fieldname <> 1;

Concatenate (LinkTable)

LOAD DISTINCT FieldName,

          'C' as Flag

Resident Fact;

kavita25
Not applicable

Re: How to write if condition to get all values in the script...

Thanks...

But I don't want to do concatenation..is there any simple solution..like in if condition itself..?

sunny_talwar
Not applicable

Re: How to write if condition to get all values in the script...

AFAIK, if won't be able to handle it. Why are you hesitant to use concatenation here? your data model should not be impacted too much because you won't expand your Fact table, it will only be a link table.

kavita25
Not applicable

Re: How to write if condition to get all values in the script...

Okay..i tried...Thanks for the solution..