Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Double Apply Map

Good day

I have my mapping load table with all the mapping detail that is required for a applymap.

But now I want to apply the map to different fields in different tables.

Only doing the apply map once in order to get one field to use in the front end.

Is this possible?

Juice Table:
JuiceName

                                                        

SoftDrink Table:
SoftDrinkName

MappingDrinksDrinkName
CokeSDCoke
SpriteSDSprite
FantaSDFanta
OrangeJuiceOrange
MangoJuiceMango
AppleJuiceApple

I tried

applymap('MappingDrinks',SoftDrinkName, JuiceName) as Drinks

Thanks in advance

6 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

I'm affarid to dissapoint you, but you can't make a double applymap. Lete me ask you this question because I didn't understood your issue: What you are trying to achieve? Please explain us better

Regards,

MB

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Corleen,

so, if I understand you correctly you have done a single MAPPING LOAD.

Given that you are loading two tables, one for Juices, and one for SoftDrinks, you will need to do two applymaps, using the same mapping table. These will be:

applymap('MappingDrinks', JuiceName) as Drinks

and

applymap('MappingDrinks', SoftDrinkName) as Drinks

You will then end up with a common field named Drinks.

I'm not sure what the structure of your data model is, so this may cause linking issues.

Marcus

sunny_talwar

Can you elaborate on what you are trying to do? I am not sure I understand what you are trying to do . Would you be able to provide a sample

Anil_Babu_Samineni

What is the expected o/p using Apply Map?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
stigchel
Partner - Master
Partner - Master

It looks like you want to combine two fields from different tables? You can Resident load form these tables to create a new field Drinks. I'm not even sure you would need a map, I would also create a field say SortOfDrink. This looks like this:

Drinks.png

Script something like this:

JuiceTable:

Load * Inline [JuiceName

Orange

Mango

Apple

];

                                                       

SoftDrinkTable:

Load * Inline [SoftDrinkName

Coke

Sprite

Fanta

];

Drinks:

load

'Juice' as SortOfDrink,

JuiceName as [Drinks]

Resident JuiceTable;

//This concatenates to the table above

load

'Soft Drink' as SortOfDrink,

SoftDrinkName as [Drinks]

Resident SoftDrinkTable;

//If not needed anymore, dropping the original tables

Drop Table JuiceTable;

Drop Table SoftDrinkTable;

santiago_respane
Specialist
Specialist

Hi,

you would be able to do it if both fields where in the same table. But with your structure as it is you wont be able to map both fields.

The syntax should be something like this:

applymap('MappingDrinks',SoftDrinkName, applymap('MappingDrinks',JuiceName,'No map value')) as Drinks


It would be great if you share a sample app in order for us to give you a more accurate answer, otherwise we are just guessing here.


Please let me know if this helps.

Kind regards,