Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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
Highlighted

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

Highlighted
MVP
MVP

Use GetCurrentSelections() instead of getcurrentfield().

Highlighted
Contributor III
Contributor III

Brilliant as usual Sunny!

Thank you

Highlighted
Master
Master

Hi Christine,

Try:

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

Regards

Andrew