Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
christinehuband
Contributor III
Contributor III

Test for two specific selections

This should be really simple but I can't see it.

We have a selection box (Company) with four possible selections (say 'ABC','DEF','GHI','JKL'). I have a text box that reads the selection and uses it concatenated with 'Report' to provide a header (=Company & ' Report').

So selecting 'ABC' produces a text box with 'ABC Report' etc.

However we select two specific Company selections, say 'DEF' and 'GHI' I want the text box to say 'MNO Report'.

I tried:

=if(GetCurrentField(Company) ='DEF' and GetCurrentField(Company)='GHI,'MNO',Company) & ' Period Report'

Any ideas?

1 Solution

Accepted Solutions
sunny_talwar

May be this

If(SubStringCount(Concat(DISTINCT '|' & Company & '|'), '|DEF|') = 1 and SubStringCount(Concat(DISTINCT '|' & Company & '|'), '|GHI|') = 1, 'MNO', Company) & ' Period Report'

View solution in original post

4 Replies
sunny_talwar

May be this

If(SubStringCount(Concat(DISTINCT '|' & Company & '|'), '|DEF|') = 1 and SubStringCount(Concat(DISTINCT '|' & Company & '|'), '|GHI|') = 1, 'MNO', Company) & ' Period Report'

tresesco
MVP
MVP

Use GetCurrentSelections() instead of getcurrentfield().

christinehuband
Contributor III
Contributor III
Author

Brilliant as usual Sunny!

Thank you

effinty2112
Master
Master

Hi Christine,

Try:

If(Concat(Company,'|') ='DEF|GHI', 'MNO Report', Company & ' Report') 

Regards

Andrew