Data Table filter for <, >, or >= as variable

Hi all;
I want to do something like this to filter data based on an operator that should be stored in a variable since it can be <,>, >= or <=
How could I configure my expression without getting any errors?
Note: The column to filter, the operator and the value are going to be variables.
Thanks

Hi @Allison_Cruz ,

Isn’t it a little redundant to do so?
Why not use the operators themselves?

Also, when you store values to a variable, it is stored as String, so you can’t store an operator and expect the software to understand what that variable contains.

Would have been nice though if software were that intelligent, but here you have to explicitly tell the compiler what sort of comparison you want to perform.

Kind Regards,
Ashwin A.K

Yes it would be easier to use the operators themselves but in this case the operator isn´t a constant, sometimes the filter should be “less than” , “more than” or “less or equal than”, that´s why I´m having this issue.
I there a way to do that?

Hi @Allison_Cruz ,

Could you maybe try using a Switch Activity instead?
You could use store the operator as a variable, no issue there, and then use a Switch Statement to handle each operation, how does that sound?

Kind Regards,
Ashwin A.K

Oooh yes I think that could work, let me try it…

Hi @Allison_Cruz

Something like this is much easier to maintain and doesn’t require any complex logic →

image
h

Kind Regards,
Ashwin A.K

It worked, I only removed the quotation marks from the cases:


Thaks a lot!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.