31
Views
4
Comments
Filtering Aggregates in Outsystems

I have List of Customers..Each customer will have many active campaigns..In overview Screeni need to add filters where we can filter through campaigns and also exclude the customers with Campaign name.. For example if we  have Campaign 1,Campaign 2 and Campaign 3, i can able to include campaign1 and 2 and exclude users with campaign 3
I have filter logic for aggregate but it is not working as expected...

If(IncludeCampaign1,UserData.IsHavingCampaign1=True,False) or
If(IncludeCampaign2,UserData .IsHavingCampaign2=True  ,False) or
If(IncludeCampaign3,UserData .IsHavingCampaign3=True  ,False) and        
If(ExcludeCampaig1 , UserData .IsHavingCampaign1 = False, False) or    
If(ExcludeCampaig2 , UserData .IsHavingCampaign2  = False, False) or    
If(ExcludeCampaig3 , UserData .IsHavingCampaign3  = False, False) 

2018-05-11 10-51-15
Tiago Reis

Hi. I would do instead of an aggregate, use an advanced queries using the IN and NOT IN in the where clauses.


2024-10-12 12-11-20
Kerollos Adel
Champion

hi @Joe AJ  , 

I hope this response is helpful and helps you solve your problem. 


(

    (IncludeCampaign1 AND UserData.IsHavingCampaign1 = True) OR 

    (IncludeCampaign2 AND UserData.IsHavingCampaign2 = True) OR 

    (IncludeCampaign3 AND UserData.IsHavingCampaign3 = True)

)

AND

(

    (NOT ExcludeCampaign1 OR UserData.IsHavingCampaign1 = False) AND

    (NOT ExcludeCampaign2 OR UserData.IsHavingCampaign2 = False) AND

    (NOT ExcludeCampaign3 OR UserData.IsHavingCampaign3 = False)

)


2024-07-09 06-45-01
Adarsh

Hi @Joe AJ 

Please update your logic with below condition it will solve your problem,

(

   (IncludeCampaign1 and UserData.IsHavingCampaign1 = True)

   or

   (IncludeCampaign2 and UserData.IsHavingCampaign2 = True)

   or

   (IncludeCampaign3 and UserData.IsHavingCampaign3 = True)

)

and

(

   (not ExcludeCampaign1 or UserData.IsHavingCampaign1 = False)

   and

   (not ExcludeCampaign2 or UserData.IsHavingCampaign2 = False)

   and

   (not ExcludeCampaign3 or UserData.IsHavingCampaign3 = False)

)


Please let me know if you have any doubts.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Adarsh ,

There is not much value in just repeating the same thing, this answer is exactly the same as was already given 2 days ago.

If you heavily agree with it, give it a thumbs up instead.

Dorine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.