Five Stars

Logic in Tmap

Hi team,

My logic is, from  column1 if value is TEST or MASTER print it as TEST or MASTER in o/p column1 and load the ID of TEST or MASTER from i/p column2 to o/p column2.

If column1 contains other then TEST or MASTER print it as NA in o/p column1 and load the ID of NA from i/p colummn2 to o/p column2.

The problem i'm facing is, i was able to get the proper o/p of ID for TEST or MASTER but for NA i'm getting null values.

In tmap variable i'm changing the values of column1 to TEST or MASTER or NA. And in expression editor i'm fetching the required values from i/p column2.

There are 20k records which contains TEST,MASTER,NA in my o/p column1, but only 10k records contains the ID which are TEST,MASTER in o/p column2 and rest is null which contains NA in o/p column2. Is there any way to get the ID of NA. Whether i need to change anything in expression editor.

My job design is thiveinput->tmap->thdfsoutput-thiveload

Input and output columns are string.

 

Regards

SS

  • Big Data
  • Data Integration
5 REPLIES
Six Stars

Re: Logic in Tmap

Hi Sri,

 

If possible please provide some sample data and expected output.

 

Regards,

 

Veeranjaneyulu Boppudi
Five Stars

Re: Logic in Tmap

Hi Veeranjaneyulu Boppudi,

Thanks for your quick response.



forum.PNG

 

Regards 

SS

Six Stars

Re: Logic in Tmap

Please find the logic below.

eScenario4.PNGScenario41.PNG 

 

Regards,

 

Veeranjaneyulu Boppudi
Five Stars

Re: Logic in Tmap

Hi this was helpful.
If my ID contains in additional input column3 and column4 also, I cannot map directly to the output column 2.

Regards
SS
Six Stars

Re: Logic in Tmap

Hi Sri,

 

Please provide complete requirement and sample data. So that it will be easy to understand requirement and provide solution.

 

Regards,

Veeranjaneyulu Boppudi