order of priority

One Star

order of priority

[size=3][font=Times New Roman","serif]Hello,[/font][/size]

[size=3][font=Times New Roman","serif]I am working with one JSON file.[/font][/size]

[size=3][font=Times New Roman","serif]After using tnormalize data is showing for ex.[/font][/size]

[size=3][font=Times New Roman","serif]Name  Type         Add[/font][/size]

[size=3][font=Times New Roman","serif]A        PH            1[/font][/size]

[size=3][font=Times New Roman","serif]A        BA            2[/font][/size]

[size=3][font=Times New Roman","serif]B        CR            3[/font][/size]

[size=3][font=Times New Roman","serif]B        ML            4[/font][/size]

[size=3][font=Times New Roman","serif]C        BL             5[/font][/size]

[size=3][font=Times New Roman","serif]C        ML            6  [/font][/size]

[size=3][font=Times New Roman","serif]Order of priority for column Type would be[/font][/size]

[size=3][font=Times New Roman","serif]1. PH[/font][/size]

[size=3][font=Times New Roman","serif]2. BL[/font][/size]

[size=3][font=Times New Roman","serif]3. ML[/font][/size]

[size=3][font=Times New Roman","serif]4. CR[/font][/size]

[size=3][font=Times New Roman","serif]want output like[/font][/size]

[size=3][font=Times New Roman","serif] [/font][/size][size=3][font=Times New Roman","serif]Name  Type        Add[/font][/size]

[size=3][font=Times New Roman","serif]A        PH            1[/font][/size]

[size=3][font=Times New Roman","serif]B        ML            4[/font][/size]

[size=3][font=Times New Roman","serif]C        BL            5[/font][/size]

[size=3][font=Times New Roman","serif] [/font][/size]
[size=3][font=Times New Roman","serif]Please suggest.[/font][/size]

Highlighted
One Star

Re: order of priority

Please suggest on the above mentioned query.
I need to select data as priority of column "Type" and discard other records for the "Name" column
One Star

Re: order of priority

you have several options, do you have already know the diferent types? how do you chose the value you re going to keep if there are several (B        ML            4 and C        ML            6  ) in your exemple. How can you define the priority (manually or in db?)
One Star

Re: order of priority

yes I know different types and order of the priority is fixed: for ex.
[size=3][font=Times New Roman","serif]1. PH[/font][/size]
[size=3][font=Times New Roman","serif]2. BL[/font][/size]
[size=3][font=Times New Roman","serif]3. ML[/font][/size]
[size=3][font=Times New Roman","serif]4. CR[/font][/size]
[size=3][font=Times New Roman","serif]5. BA[/font][/size]
[size=3][font=Times New Roman","serif]I need to define the priority manually in the job. [/font][/size]
One Star

Re: order of priority

MMh, i think you will have to split your flow:
1) tnormalize
2) Tmap (you change the schema as you like it deleting columns and you split depending on the value of the type PH,BL
 as you know it)
3)you put all of your Tmap outputs in several temp files or in hashOutput if you care for perf.
4) On subjob ok -> all hashInput or TfileInput connected to Tunite in the order you want.
you have your flow

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