Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
smanas
Contributor III
Contributor III

if condition to include certain values and exclude some values

Hi I'm trying to write an if condition, here A55 also includes A55.1,A55.2 and so on, I would like to include A89.91 and exclude A64.3, please advise

=if(Match(Left("Codes",3),
'A55',
'A56',
'A57','A58','A59','A60','A61','A62','A63','A64',
'A65',
),'yes','no')

 

Labels (1)
1 Solution

Accepted Solutions
smanas
Contributor III
Contributor III
Author

=if(Match(Left('ABCD',3),
'A55',
'A56',
'A57','A58','A59','A60','A61','A62','A63','A64',
'A65','A89.91',
),'yes', if(Match(Left('ABCD',3),'A64.3'),'no'))

Hello @agigliotti , is this correct?

View solution in original post

5 Replies
agigliotti
MVP
MVP

Hi @smanas ,

Maybe this:

=if(Match( Left(ABISCA,3),
'A55',
'A56',
'A57','A58','A59','A60','A61','A62','A63','A64',
'A65',
) and ABISCA <> 'A64.3',
'yes',
if( ABISCA = 'A89.91',
'yes','no'
)
)

I hope it can help.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
romansysyuk
Contributor II
Contributor II

map_codes:
Load * Inline [key, value
A55, yes
A56, yes
A57, yes
A58, yes
A59, yes
A60, yes
A61, yes
A62, yes
A63, yes
A64, yes
A65, yes
];

Load ApplyMap('map_codes', Subfield(Codes, '.', 1), 'no') as [flag column]
...

smanas
Contributor III
Contributor III
Author

=if(Match(Left('ABCD',3),
'A55',
'A56',
'A57','A58','A59','A60','A61','A62','A63','A64',
'A65','A89.91',
),'yes', if(Match(Left('ABCD',3),'A64.3'),'no'))

Hello @agigliotti , is this correct?

agigliotti
MVP
MVP

Did you check my suggestion?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
smanas
Contributor III
Contributor III
Author

Hi @agigliotti  it worked thanks a lot