Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

adoteykwame
Contributor

IF statement doesnt return all

Hi,

can someone please tell me what's wrong with this statement.

If(BRANCH ='DOME' OR 'MAKOLA' OR  'AVENOR' OR  'MUUS','GREATER ACCRA',IF(BRANCH = 'SWEDRU','CENTRAL',IF(BRANCH ='KUMASI','ASHANTI',NULL()))) as Region;

when i select GREATER ACCRA from Region it only shows DOME and not the rest MAKOLA, AVENOR and MUUS.

Thanks

1 Solution

Accepted Solutions
rajni_batra
Valued Contributor

Re: IF statement doesnt return all

if statement does not work like this

use

if (Match(Branch,'DOME','MAKOLA' ,'AVENOR','MUUS'),'GREATER ACCRA',

  if(Branch='SWEDRU','CENTRAL',

   IF(BRANCH ='KUMASI','ASHANTI',Null()))) as Region

3 Replies
rajni_batra
Valued Contributor

Re: IF statement doesnt return all

if statement does not work like this

use

if (Match(Branch,'DOME','MAKOLA' ,'AVENOR','MUUS'),'GREATER ACCRA',

  if(Branch='SWEDRU','CENTRAL',

   IF(BRANCH ='KUMASI','ASHANTI',Null()))) as Region

nilesh_gangurde
Valued Contributor

Re: IF statement doesnt return all

IF(wildmatch(BRANCH ,'DOME' , 'MAKOLA' ,  'AVENOR' , 'MUUS') , 'GREATER ACCRA',

IF(wildmatch(BRANCH = 'SWEDRU') , 'CENTRAL',

IF(wildmatch(BRANCH ,'KUMASI') , 'ASHANTI',

NULL()))) as Region

Regards,

Nilesh Gangurde

adoteykwame
Contributor

Re: IF statement doesnt return all

Thanks a lot