Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mahesh_Dev
Contributor III
Contributor III

tmap logic

hello everyone,

could any one help me below logic.

1.   I have two columns a & b.  

 input : -

 a            b      

hello       null

null          world

 

output :-

a            b      

hello       world

 

how to achieve this output using tmap?

 

thanks

mahesh

Labels (4)
2 Replies
Anonymous
Not applicable

Hi,

 

    An easy way is to assign is to first provide a sequence number for each row and store the output in hash output.

 

    Then read the hash both as main and lookup and left join the row number in main column with row number -1 in lookup flow.

 

     In this way, you will be able to match with both flows and get the output based on NULL check conditions.

 

     Another way is to do it through tjavarow where you can store the data from current record to context variables and compare the data in context variables and main flow using if-else conditions.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

David_Beaty
Specialist
Specialist

Hi,

 

As you're combining 2 rows into 1 and taking the non-null values to form the new row, you could use the tAggregateRow component, with the Aggregate rules for the 2 columns set as "First" and the "Ignore Null Values" option ticked.