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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
innashna
Contributor II
Contributor II

Getfieldselections with multiple values in if condition

Hello,

I need to build condition where image is getting replaced only if two particular values are selected.

When only one value had to be selected I used :

(IF(Match(GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME]),'EVPL', 'EDI','ENS','EPL'),'qmem://image name/Metro_E' )

Now there is a requirement to present image Metro_E when the following logic acts:

match (DD_Solution_Leg_SOLUTION_NAME,'EVPL','EDI','ENS','EPL') and match (DD_Solution_Leg_SOLUTION_NAME,'Business Internet')

 

How I use this condition in the GetFields Selection function?

Thanks,

Inna

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

May be this

If((
SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EVPL|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EDI|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|ENS|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EPL|') = 1
) and (
SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|Business Internet|') = 1
), 'qmem://image name/Metro_E')

View solution in original post

6 Replies
sunny_talwar

Is this saying that DD_Solution_Leg_SOLUTION_NAME is either one of the following ('EVPL','EDI','ENS','EPL') and in addition 'Business Internet' is also selected?

innashna
Contributor II
Contributor II
Author

Yes
sunny_talwar

What if the user select 3 values

1) EVPL

2) ENS

3) Business Internet

Would you still want to show the image or not?

innashna
Contributor II
Contributor II
Author

Yes.
sunny_talwar

May be this

If((
SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EVPL|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EDI|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|ENS|') = 1 or SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|EPL|') = 1
) and (
SubStringCount('|' & GetFieldSelections([DD_Solution_Leg_SOLUTION_NAME], '|') & '|', '|Business Internet|') = 1
), 'qmem://image name/Metro_E')
innashna
Contributor II
Contributor II
Author

Works!! Genius!!!Thanks!!