Talend tmap lookup on multiple conditions with the same lookup table

时间:2017-12-18 05:40:40

标签: talend

I'm using talend to build out a job but have run into a problem.

I have multiple variables that need to be created that each rely on a lookup of table, 'X'.

For example,

  var_a = tablex.columnA where tablex.columnb == "A"
  var_b = tablex.columnA where tablex.columnc == "B"

etc.

Unfortunately it seems that using the lookup functionality in the left pane affects the entire tmap function - i.e., you can't restrict to columnB for some variables and columnC for others.

Is it possible to build var_a and var_b without having to replicate the lookup table subjob each time? Is there a way to do this using the expression editor?

EDIT: I've drafted a few slides with screenshots to more clearly show my problem. Please take a look here: https://docs.google.com/presentation/d/1OeIGEIpxPXPJtjGAfpAWj83jhCMDSLbSMb3ygZism9Q/edit?usp=sharing

1 个答案:

答案 0 :(得分:0)

VarA setting

VarB setting

您需要将1个人文件作为主文件,将2个地址文件作为查找,因为根据您的数据,对于国家/地区值,您需要首先匹配查找和性别值,您需要匹配模型作为最后一个匹配。

用于第一次查找,在tMap匹配ID列中,并编写下面给出的国家/地区人口的表达式。

对于第二次查找,在tMap匹配ID列中,并编写下面给出的性别群体的表达式