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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Populate data on the basis of priority

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
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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 🙂

View solution in original post

4 Replies
manodwhb
Champion II
Champion II

@Vibin_CT ,check the below one.

 

0683p000009M3Ys.png0683p000009M3Yx.png

Anonymous
Not applicable
Author

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 🙂

Anonymous
Not applicable
Author

@nthampi:

 

Thank you very much!!  0683p000009MACn.png

 

@manodwhb: Thanks for your quick response, but your first condition won't provide expected result, because if we find channel with only 'sfdc', we should ignore other records from the same group. I am okay with the solution provided by @nthampi .

Anonymous
Not applicable
Author

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 🙂