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: 
CanKyle
Contributor
Contributor

If Statement where condition value is repeated

Hi

I am trying to do an IF statement where department ID's form new departments and all the new department forms a sum of all of the departments. The problem I am getting is that either the sum of the departments doesnt return data or the new departments doesnt return data. See expression below:

=if(match(rlc_product_clssfctn_id_code,'9520','9530','1010','1020'),'CFH',//,'1030','1040','1060','1070','2010','2020','2030','2040','4010','4020','4030','4040','4050','4060','8110','3020','8090','8050','3030','8010','8100','8120','8020','8060','8080','8030','8070','8040'),'CFH',
if(match(rlc_product_clssfctn_id_code,'1010','1020'),'Women',//,'1030','1040','1060','1070','2010','2020','2030','2040','4010','4020','4030','4040','4050','4060'),'WOMEN',
if(match(rlc_product_clssfctn_id_code,'8100','8120','8020','8060','8080','8030','8070','8040'),'Kids 2 - 15',
if(match(rlc_product_clssfctn_id_code,'8010'),'Baby',
if(match(rlc_product_clssfctn_id_code,'8110','3020','8090','8050','3030'),'Footwear',
if(match(rlc_product_clssfctn_id_code,'9520','9530'),'Bed and Bath',
null()))))))

the first line named CFH is a combination of all the others

1 Reply
CanKyle
Contributor
Contributor
Author

Sorry this is the correct expression:
=if(match(rlc_product_clssfctn_id_code,'9520','9530','1010','1020','1030','1040','1060','1070','2010','2020','2030','2040','4010','4020','4030','4040','4050','4060','8110','3020','8090','8050','3030','8010','8100','8120','8020','8060','8080','8030','8070','8040'),'CFH',
if(match(rlc_product_clssfctn_id_code,'1010','1020','1030','1040','1060','1070','2010','2020','2030','2040','4010','4020','4030','4040','4050','4060'),'WOMEN',
if(match(rlc_product_clssfctn_id_code,'8100','8120','8020','8060','8080','8030','8070','8040'),'Kids 2 - 15',
if(match(rlc_product_clssfctn_id_code,'8010'),'Baby',
if(match(rlc_product_clssfctn_id_code,'8110','3020','8090','8050','3030'),'Footwear',
if(match(rlc_product_clssfctn_id_code,'9520','9530'),'Bed and Bath',
null()))))))

 

The CFH contains all the values of women,baby, kids 2-15,bed and bath

 

Community Browser