Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Mix ANDs and ORs in a "Filter component"

Hello,

Is possible to mix "combine conditions" (ANDs and ORs) in a "Filter component"?

It can have multiple conditions joined by ANDs or ORs but it does not except filters with AND + OR at the same time. How could we build a complex filter mixing them?

Example: (col_A='me' AND col_B>=32) OR (col_C<10 AND col_d!=1)


Regards,

Josep

2 Community Answers

Best Answer  >Matillion Agent  

Dan D'Orazio —

Hi Josep -

it’s a great question. Unfortunately, it’s not possible to do this in the Filter Transformation directly. However, you can accomplish the same result by encapsulating the conditional logic in a derived column, using a Calculator Component just before it.

In your example, you would create the condition with a CASE statement (for example) where the result was a single value, like 1 or ‘True’, etc. The Filter Component would then use that value in the filter condition.

I hope that helps and please feel free to reach out if you need anything else.

Best -
Dan

Best Answer  Matillion Agent  

Dan D'Orazio —

Hi Josep -

it’s a great question. Unfortunately, it’s not possible to do this in the Filter Transformation directly. However, you can accomplish the same result by encapsulating the conditional logic in a derived column, using a Calculator Component just before it.

In your example, you would create the condition with a CASE statement (for example) where the result was a single value, like 1 or ‘True’, etc. The Filter Component would then use that value in the filter condition.

I hope that helps and please feel free to reach out if you need anything else.

Best -
Dan


Josep Martinez —

Hi Dan,

Thank you for your answers in the three questions!

Interesting workarround to use the Calculator + Filter :-)


Regards,

Josep

Post Your Community Answer

To add an answer please login