Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am stuck with a scenario, given below,
I need to populate target table on the basis of some priority on source data, if the high priority record found then other records should not load into target from the same group, it should be get rejected. If the high priority item not found, it should check other below priority record, if found, load the same into target and ignore other records in the same group, example below,
Priority Order:
1. sfdc
2. sfdc,dc,fg ( if channel like '%sfdc%')
3. *
Note: There is no specific KEY column available, combination of columns can make a KEY.
1. if source data comes like below, it should load only last record,
| name | chargecode | groupcode | channel |
| sme1 | 50958 | 5098 | * |
| sme1 | 50958 | 5098 | sfdc,dc,fg |
| sme1 | 50958 | 5098 | sfdc |
2. In this case 2nd record should loaded
| name | chargecode | groupcode | channel |
| sme1 | 50958 | 5098 | * |
| sme1 | 50958 | 5098 | sfdc,dc,fg |
3. If the source record coming with single channel, then it should load, so in this case priority is not required,
| name | chargecode | groupcode | channel |
| sme1 | 50958 | 5098 | sfdc,dc,fg |
| name | chargecode | groupcode | channel |
| sme1 | 50958 | 5098 | * |
| name | chargecode | groupcode | channel |
| sme1 | 50958 | 5098 | sfdc |
Hi,
The most easy method is to have a ranking config table for each channel and then do a lookup with this table to get the ranking for each record. Order the incoming data based on key columns and rank. Then for each data group (using taggregaterow), pick the first record which is having highest rank.
This should resolve your issue.
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 🙂
Hi,
The most easy method is to have a ranking config table for each channel and then do a lookup with this table to get the ranking for each record. Order the incoming data based on key columns and rank. Then for each data group (using taggregaterow), pick the first record which is having highest rank.
This should resolve your issue.
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 🙂
Thanks for the update @Vibin_CT
Since you have the solution, could you please mark the topic as closed? Kudos are also welcome 🙂
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 🙂