Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
siddharthsoam
Partner - Creator II
Partner - Creator II

can we have multiple true values in if

I want to have multiple true values for a condition in if statement in qliksense

ex-

quarter   previous quarters

3                 1

                   2

please help me with the problem

1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Siddhart,

If I understood your question, you need to create a table with previous quarters based on quarter values.

The following script:

x:

Load * Inline

[

Quarter

1

2

3

4

];

y:

Load

Quarter,

if (Quarter=1,Null(),IterNo()) as [Previous Quarter]

Resident x

While IterNo() <=Quarter;

drop table x;

NoConcatenate

data:

Load

Quarter,

[Previous Quarter]

Resident y

where Quarter <> [Previous Quarter];

drop table y;

Gets the following output:

Sample.png

Since you now have the Quarter and Previous Quarter mapped out, now you could do the if statement on the new field.

Is that what you need?

View solution in original post

1 Reply
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Siddhart,

If I understood your question, you need to create a table with previous quarters based on quarter values.

The following script:

x:

Load * Inline

[

Quarter

1

2

3

4

];

y:

Load

Quarter,

if (Quarter=1,Null(),IterNo()) as [Previous Quarter]

Resident x

While IterNo() <=Quarter;

drop table x;

NoConcatenate

data:

Load

Quarter,

[Previous Quarter]

Resident y

where Quarter <> [Previous Quarter];

drop table y;

Gets the following output:

Sample.png

Since you now have the Quarter and Previous Quarter mapped out, now you could do the if statement on the new field.

Is that what you need?