Finding relation in sections entry

Seven Stars

Finding relation in sections entry

I have data like below table how do I maintain relation between section and parentid ?
sectionid parentid code codesystem
708 0 NULL NULL
709 708 123 1.2
710 709 NULL NULL
711 709 NULL NULL

For ex: As per below table if sectionid 709 need to find all parentids with 709 and if parentid 709 available then need to check code and codesystem values null or not . if null get the values from sectionid 709 and update those values into parentid 709.

can someone guide me how can I achevie this in talend.

if not understand please let me know.
Tags (1)
Forteen Stars

Re: Finding relation in sections entry

@prasan , if possible can you provide required output also?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: Finding relation in sections entry

Hi

Thanks for quick response.

Output should be like this.


sectionid parentid code codesystem
708 0 NULL NULL
709 708 123 1.2
710 709 123 1.2
711 709 123 1.2

Forteen Stars

Re: Finding relation in sections entry

@prasan , Please check the below one.

1.png2.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: Finding relation in sections entry

Data is from db and will it work for if many parent ids repeated also
Forteen Stars

Re: Finding relation in sections entry

@prasan ,yes it will work, but you need to have data what you have provided in the way.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: Finding relation in sections entry

Hi

Thanks for the solution.

Let me try this once with my actual data..
Seven Stars

Re: Finding relation in sections entry

thanks for your solution,it works fine for me
But i need one more solution,As per your solution it was updating where sectionid 708 and parentid 708 records also
i don't want to update that ,please find below screenshot

 

can you please provide me solution for the below one.

 

 

Forteen Stars

Re: Finding relation in sections entry

@prasan ,why cannot you filter record which you wan to do the join?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: Finding relation in sections entry

Yes we can,but I need to load that record also without updating those
values.

For ex:sectionid 708 values don't want to update in parentid 708.is there
any alternative way to do in Tmap same as you did.

Thanks,
Prasan


Seven Stars

Re: Finding relation in sections entry

Hi,

Any solution?

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog