Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
skkrishna
New Contributor III

case Statement in Qlikview

Hi,

I was wondering if anyone would be able to help me.  I want to create the following Case statement in QlikView:

CASE

  WHEN DISTRICT IN ('0317','0328','0030','0057','0122','6057','6130','6150','6317','6631') AND

  YYYYMM <= '201602' THEN 'A'

  WHEN DISTRICT IN ('0317','0328','0030','0057','0122','6057','6130','6150','6317','6631') AND

  YYYYMM BETWEEN '201603' AND '201605' THEN 'B'

  ELSE 'C' END AS STAGES,

Is this possible to do within QlikView?

Any help would be greatly appreciated.

thanks.

1 Solution

Accepted Solutions
sergio0592
Valued Contributor II

Re: case Statement in Qlikview

Try

If(match(DISTRICT,'0317','0328','0030','0057','0122','6057','6130','6150','6317','6631')>0 and YYYYMM <= '201602','A',if(match(DISTRICT,'0317','0328','0030','0057','0122','6057','6130','6150','6317','6631')>0 and (

YYYYMM > '201603' AND YYYYMM <'201605'),'B','C'))

2 Replies
sergio0592
Valued Contributor II

Re: case Statement in Qlikview

Try

If(match(DISTRICT,'0317','0328','0030','0057','0122','6057','6130','6150','6317','6631')>0 and YYYYMM <= '201602','A',if(match(DISTRICT,'0317','0328','0030','0057','0122','6057','6130','6150','6317','6631')>0 and (

YYYYMM > '201603' AND YYYYMM <'201605'),'B','C'))

ramasaisaksoft
Valued Contributor III

Re: case Statement in Qlikview

For Switch case also we need to follow if else conditions/Nested if only in Qlikview .