Stored List with Key and multiple Return values

  • Posts: 368
  • Karma: 2
  • Thank you received: 32

Stored List with Key and multiple Return values was created by bruce.gibbins

Hi

AETLP v6.3.6.7

I would like to simulate a (Python) Dictionary or (Java) HashMap type object that is basically a hard coded list of keys and values. That can then be stored in the Object Library and reused across a number of transformations and maintained in one spot.

The same thing could be achieved by using a table in a SQL database or even a JSON file. But I wanted to avoid having 'external' assets that needed to be maintained outside of AETL.

The use case would be that I have a VALUE extracted from a source file (CSV etc). I then need to lookup this VALUE against the list and return back a set of values that are then used in the reset of the transformation.

For example, assuming the following "List"
KEYCOL1COL2COL3
KEY1VAL1VAL2VAL3
KEY2VAL4VAL5VAL6

Then if I pass in KEY2 from the raw inbound data, I would get back COL1,COL2,COL3

This is exactly the same as using an SQL Query as a data source. The difference is that the datasource is a manually managed/entered set of values kept within AETL and possible shared via the Object Library.

cheers
The following user(s) said Thank You: admin
11 months 3 weeks ago #19828

Please Log in or Create an account to join the conversation.

  • Posts: 8125
  • Karma: 33
  • Thank you received: 510

Replied by admin on topic Stored List with Key and multiple Return values

Hi.

Thank you for the feedback.
Such object already exists and it is called Lookup

You can also load a list of values from the text file.

Mike
11 months 3 weeks ago #19829
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1138
  • Karma: 3
  • Thank you received: 135

Replied by Peter.Jonson on topic Stored List with Key and multiple Return values

Since you want to reuse Lookup transformation object you may find sub transformation very useful
Peter Jonson
Support Analist
The following user(s) said Thank You: bruce.gibbins
11 months 3 weeks ago #19830
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 368
  • Karma: 2
  • Thank you received: 32

Replied by bruce.gibbins on topic Stored List with Key and multiple Return values

Thanks, After raising the query I then thought about using a delimited string as the lookup value and then using a SPLIT action to divide the value up. Thanks for confirming the process
11 months 3 weeks ago #19832

Please Log in or Create an account to join the conversation.

  • Posts: 368
  • Karma: 2
  • Thank you received: 32

Replied by bruce.gibbins on topic Stored List with Key and multiple Return values

Hi.

I can get your suggestion working but I am curious as to what the difference is between LOOKUP and LOOKUP REPLACE other than the error handling TAB. Both seem to take an input value, do a lookup and output a result with LOOKUP REPLACE not having the ability to catch and respond to a missing key.

thanks
11 months 3 weeks ago #19833

Please Log in or Create an account to join the conversation.

  • Posts: 8125
  • Karma: 33
  • Thank you received: 510

Replied by admin on topic Stored List with Key and multiple Return values

Lookup Replace replaces one text with another inside string.

String = [Company] is great

Key Value
[Company] ETL-Tools.com

Result = ETL-Tools.com is great
Mike
The following user(s) said Thank You: bruce.gibbins
11 months 3 weeks ago #19834

Please Log in or Create an account to join the conversation.

 

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies