One Star

tFilterRow - Filter a field that contains values in the context

Hello, I want to filter a string field "EVENT_NAME" to the values in my context. My context.event is A, B, C and D.
So in the tFilterRow Advanced mode, I want to code something like this input_row.EVENT_NAME.equals(context.event). I mean input.row.EVENT_NAME.equals("A","B","C","D")
Is there a way to do it? Could you provide me the syntax to get this filter works.
Thanks in advance!
2 REPLIES
Not applicable

Re: tFilterRow - Filter a field that contains values in the context

Hello,
If I understand your problem correctly, your context variable context.event can only contain "A", "B", "C", and "D". In that case you can just use input_row.EVENT_NAME.equals(context.event) in your filter, and it should filter out all other values.
If you want to check if your field EVENT_NAME contains only one of the allowed values, you can use :
"ABCD".contains(input_row.EVENT_NAME) && input_row.EVENT_NAME.length() == 1
the second part ensures that your field is only one character, so that "AB" doesn't match for instance.
One Star

Re: tFilterRow - Filter a field that contains values in the context

Hi,
The input_row.EVENT_NAME.equals(context.event) is what I want to do to get all the rows which have "A", "B", "C" and "D". However I don't get any match. I get zero rows in my output. In my data has some "A", "B", so I should get some matched rows.
I don't know if I miss anything?
Thank you for your help!