0

I have been trying to filter a data extension with two values. Every time I try, the values are not returned. Any guidance would be greatly appreciated. This is what I tried:

Fetching the values from first DE:

var ExclusionDE = DataExtension.Init('ExternalKeyOfDE');
              var filter1 = {Property:"ExcludeFrom", SimpleOperator:"equals", Value:"IN"};
              var rows = ExclusionDE.Rows.Retrieve(filter1);
              
              for (var i = 0; i < rows.length; i++) {
             
                                           
              var value1 = rows[i].value1;
              var value2 = rows[i].value2;
              
              
              Write(Stringify(value1));
              Write(Stringify(value2)); 
              
              };

This returns the values correctly.

I am trying to use the values returned in the above For Loop to filter another DE:

 var birthdayDE = DataExtension.Init("DEToBeFiltered");
              var complexfilter = {
                              LeftOperand:{
                                  Property:"value1",
                                  SimpleOperator:"notEquals",
                                  Value:value1
                              },
                              LogicalOperator:"AND",
                              RightOperand:{
                                  Property:"value2",
                                  SimpleOperator:"notEquals",
                                  Value:value2
                      }};
              var moredata = birthdayDE.Rows.Retrieve(complexfilter);
              Write(Stringify(moredata));

Second part of filtering the DE is not returning anything. Any help or guidance?

Thank you!

3
  • Though we could NOT fully get the requirement for your Complex query... can try these two things.... 1) Hope you are assigning the values to value1 and value2.... 2) Can you try with OR operator, the AND operator seems to cause mutual exclusion and hence not giving any results. Commented Jan 27 at 5:46
  • @VishalKumarCV I am assigning values to value1 and value2 using a FOR loop. Both values are different, and filtering must be done based on combination of both the values. If OR is used, results will be different. Commented Jan 27 at 13:11
  • Thanks... if you give the full code [by masking any sensitive info] it would help the community to understand the requirement and help. Commented Jan 27 at 13:19

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.