# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## 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

1 Solution

Accepted Solutions
Valued Contributor III

## Re: can we have multiple true values in if

Hi Siddhart,

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

The following script:

x:

[

Quarter

1

2

3

4

];

y:

Quarter,

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

Resident x

While IterNo() <=Quarter;

drop table x;

NoConcatenate

data:

Quarter,

[Previous Quarter]

Resident y

where Quarter <> [Previous Quarter];

drop table y;

Gets the following output:

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?

Valued Contributor III

## Re: can we have multiple true values in if

Hi Siddhart,

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

The following script:

x:

[

Quarter

1

2

3

4

];

y:

Quarter,

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

Resident x

While IterNo() <=Quarter;

drop table x;

NoConcatenate

data:

Quarter,

[Previous Quarter]

Resident y

where Quarter <> [Previous Quarter];

drop table y;

Gets the following output:

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?