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: 
eleni_theodorid
Partner - Creator
Partner - Creator

List Box Expression

Dear All,

I have a problem with a document (the attached document). In the Layout, I want to have 3 List Boxes with expressions. At the first List Box, I want to see all Contacts that belongs to Campaign 1 (which is working good), at the second List Box I want to see all Contacts that belongs to Campaign 2 (which is also working good), and in the third List Box, I want to see all Contacts that belongs to the Campaign 1 and don't belong at Campaign 2 (which is not working) . Any ideas what to do?

Thanks in advance,

Helen

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi Helen,

You have an n:n relation between your Contacts and Campaigns, right? I think you can't solve this like you intended using if() on a per record base (well, at least not easily).

Try this using a set expression to include Campaign1 and exclude Campaign2 related Contacts:

=aggr(only({<Contact.FullName = p({<Campaign.Name={'$(Campaign1)'}>}) / p({<Campaign.Name={'$(Campaign2)'}>}) >} Contact.FullName), Contact.FullName)

Regards,

Stefan

View solution in original post

1 Reply
swuehl
MVP
MVP

Hi Helen,

You have an n:n relation between your Contacts and Campaigns, right? I think you can't solve this like you intended using if() on a per record base (well, at least not easily).

Try this using a set expression to include Campaign1 and exclude Campaign2 related Contacts:

=aggr(only({<Contact.FullName = p({<Campaign.Name={'$(Campaign1)'}>}) / p({<Campaign.Name={'$(Campaign2)'}>}) >} Contact.FullName), Contact.FullName)

Regards,

Stefan