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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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().

Anonymous
Not applicable
Author

Brilliant as usual Sunny!

Thank you

effinty2112
Master
Master

Hi Christine,

Try:

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

Regards

Andrew