Context variable as filter

Highlighted
One Star

Context variable as filter

I would like to use context variables to filter the output records on the basis of the condition which I put in context variable. 
To give and example.
My input file:
SlNo, Code
1,A
2,A
3,B
4,B
Now if my filter criteria of context variable say filter_code is A then only output records with Code A should be in output, and if B then only with Code B and if default then all the records
Five Stars

Re: Context variable as filter

you can do it using tMap configure context variable in filter expression and use something like below. 
row1.slno.equals(context.parameter) || context.parameter.equals("Default")
Six Stars

Re: Context variable as filter

Will "Default" work  as it is not a value in the column !!

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch