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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mynona
Contributor II
Contributor II

IF statement

I would like to display the following in a table:

 

Column 1           Column 2

Item No.             Value

 

Where Value is based on which article number is entered. That is, for example, article no. 1, 3, 4 and 6 are displayed, the value "Test 1" should be displayed in the column 2. If the article number is 2, 5 and 7, then the value "Test 2" should be displayed in column 2.

I think it can be solved with an IF statement, but how do I write the IF statement when there are several article numbers that should show the same value?

 

if([XXX] = ???, 'Test 1', IF[XXX] = ???, 'Test 2') ???

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Hi, If none of the specified article numbers matches, it assigns a default value ('Other'), but you can adjust this to your specific needs.

If(Match([Article No.],'1','3','4','6'), 'Test 1',
If(Match([Article No.],'2','5','7'), 'Test 2',
'Other'))

View solution in original post

3 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi, 

Maybe If(Wildmatch("Item No.",'1','3','4','6'));'Test 1';'Test 2') ?

Regards

From Next Decision and mpc with love
BrunPierre
Partner - Master II
Partner - Master II

Hi, If none of the specified article numbers matches, it assigns a default value ('Other'), but you can adjust this to your specific needs.

If(Match([Article No.],'1','3','4','6'), 'Test 1',
If(Match([Article No.],'2','5','7'), 'Test 2',
'Other'))

Mynona
Contributor II
Contributor II
Author

Thank you! This solution worked for me!