Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SK28
Creator
Creator

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
Specialist III
Specialist III

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'))

View solution in original post

2 Replies
sergio0592
Specialist III
Specialist III

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

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