1 Reply Latest reply: Sep 16, 2011 9:32 AM by Stefan Wühl RSS

    List Box Expression

    Eleni Theodoridou

      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

        • List Box Expression
          Stefan Wühl

          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