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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Nested Multi-criteria mapping

Hi,

I'm new to Talend Studio for Data Integration and am trying to understand how to manage a set of references which can be managed in a data source used in a transformation. I have another post in here because I don't have tStandardizeRow in my palette and cannot seem to find out how to install it if it is the right tool for the job.

 

What I want to set the value of "Asset" based upon a series of one or more conditions. If I wrote it as an IF THEN ELSE set of steps, it would look like this:

 

IF origin.Instrument Type

equals 'Future'

Set VALUE to destination.Asset

VALUE = 'General Future'

ELSE Set VALUE to destination.Asset

VALUE = 'General Equity'

IF origin.Instrument Type

equals 'Option'

Set VALUE to destination.Asset

VALUE = 'General Option'

IF origin.Instrument Type

equals ('Equity' OR 'Warrant')

AND origin.Custodian Account Display Name

equals 'CFD'

Set VALUE to destination.Asset

VALUE = 'Equity'

IF origin.Instrument Type

equals 'Bond'

AND origin.Custodian Account Display Name

equals 'CFD'

Set VALUE to destination.Asset

VALUE = 'Fixed Income'

IF origin.Instrument Type

equals 'Credit Default Swaption'

AND origin.Custodian Account Display Name

equals 'CFD'

Set VALUE to destination.Asset

VALUE = 'Swaption'

IF origin.Instrument Type

equals 'Interest Rate Swap'

Set VALUE to destination.Asset

VALUE = 'IRS'

IF origin.Instrument Type

equals 'CDS'

Set VALUE to destination.Asset

VALUE = 'CDS'

IF origin.Instrument Type

equals 'Repurchase Agreement'

Set VALUE to destination.Asset

VALUE = 'Repo'

Labels (2)
8 Replies
Anonymous
Not applicable
Author

Hi,

 

    Could you please try tMap (use condition expressions) or tJavaRow (where you can write Java if-else conditions) to resolve your use case?

 

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

Thanks for your response, I wanted to try to achieve this without codes using reference or rules data and apply one or more rules to a value in the mapping. If I end up adding Java into the mapping then the references themselves cannot be managed outside of the map by non-technical business users. How would you approach this without hard-coding rules and values?

 

Thanks, Matt

Anonymous
Not applicable
Author

Is there a better way of doing a series of conditions with alternative actions using the paid version of Talend vs Open Studio? tStandardizeRow sounds interesting but might only be for specific data payload types for addresses, phone numbers, etc - I don't have that feature available on Open Studio so not entirely sure. Thanks, Matt
cterenzi
Specialist
Specialist

Most of your conditions center around mapping Instrument Type to a desired Asset value. Some of the conditions don't appear to be fully covered. (ex: What happens if the Instrument Type is Bond and the Custodian Account Display Name is not CFD?)

I would probably approach this as a lookup table, stored either in a database or a file that maps Instrument Types to their corresponding Asset values. I would apply the lookup regardless of conditions on the Custodian Account Display Name and simplify the conditional to use the lookup value or some replacement value.

If you want to avoid checking the value of CADN in the code at all, then you can either include all the CADN values in the lookup table or else just the mappings when CADN = 'CFD' and != 'CFD'.

Ex:

Instrument Type		CADN	Asset
======================================
Future				General Future
Option				General Option
Equity			CFD	Equity
Equity				Other
Bond			CFD	Fixed Income
Bond			CFD	Other
DEFAULT DEFAULT VALUE etc.

This would allow changes to the mappings without needing to update the Talend job.  You might need to apply the mappings more than once, and might need a special routine to handle and apply the default value for cases not handled by the rest of the mapping table.

Anonymous
Not applicable
Author

Thanks for this - yes, this is more like it. There is an ELSE action in that table which is to set value to General Equity - far right column.
I was looking to do a lookup table as well but couldn't figure out how you would enter a lookup to file to resolve the value required and how I could incorporate it so that, if no match, THEN set value to General Equity.
Anonymous
Not applicable
Author

additionally, the 'CFD' is a CONTAINS within string rather than EQUALS, which I cannot find a function to use in an expression for. I was going to have the table with explicit rows so have a resolve for:

1. Instrument Type equals x ANDCADN contains 'CFD'
2. Instrument Type equals x AND CADN does not contain 'CFD'

Thanks, Matt
Anonymous
Not applicable
Author

Hi,

 

    If your use case is related to creation validation rules by business users themselves, one approach will be to provide Talend Data Prepartion tool for the business users. They can create all the data quality use cases themselves since the Talend Data preparation allows the business rules creation like a smart excel sheet.

 

    Once they create the Rules using Talend Data Preparation, you can use those recipes within Talend Studio by connecting to those recipes. Then you can implement these rules for production loads.

 

https://www.talend.com/resources/what-is-data-preparation/

 

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

thanks for this, would it also be used by operational support to adjust calculations when a client decides to change the origin data without giving us appropriate notice? I just want to make sure it also has a life as an administration tool to the mapping as well as the creator of it. Thanks