Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
Partner - Champion
Partner - Champion

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

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
Partner - Champion
Partner - Champion

Did you check my suggestion?

smanas
Contributor III
Contributor III
Author

Hi @agigliotti  it worked thanks a lot