An expression is a selector component that inherits attributes from a preceding component in the flow and adds additional resuabale attributes. Attributes can be renamed and transformed from source attributes using SQL expressions.
The best use of an expression component is in cases where intermediate transformations are used multiple times such as when pre-calculating fields that are used in multiple targets.
Use case:
- First use a filter on Regions table(where Region_id ='4' )
- and then join them between countries and Regions based on join condition(countries.region_id =regions.region_id)
- and then connect the join with an expression component which inherits all fields from countries and regions tables.
- Now we will use a subquery filter component with expression and locations tables based on conditon - Expression.country_id =Locations.country_id.
- And then use the subquery result to target table Locations_EXP.