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

tiny question about ApplyMap syntax

I was reading the great explanation regarding ApplyMap by Steve Dark

http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/

a question came up in my mind:

if I have

MapProducts:

MAPPING LOAD

ProductID,

description;

LOAD

Order

ApplyMap('MapProducts',ProductID,'N/A') as Item

RESIDENT Order_table;

is this expected to work perfectly, since I am not explicitly loading ProductID from the resident Order_table?

Further, by using this syntax, I should NOT expect to see the field ProductID in the dashboard, right?

thank you!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think your Mapping load misses a data source (FROM, RESIDENT etc.).

You don't need to explicitely load the ProductID in your table, and using above load you should not expect to see the ProductID field in your data model.

View solution in original post

5 Replies
swuehl
MVP
MVP

I think your Mapping load misses a data source (FROM, RESIDENT etc.).

You don't need to explicitely load the ProductID in your table, and using above load you should not expect to see the ProductID field in your data model.

Not applicable
Author

I think you would have to type this:

'drop table Order_table';

at the end

to not have ProductId...

Clever_Anjos
Employee
Employee

You creating your mapping table from your source table. It won´t work.

You should populate your Mapping Table before using it (inline, excel, whatever)

Not applicable
Author

MapProducts: 

MAPPING LOAD  ProductID,  description

from <table>;

tab2:

  LOAD  Order,  ApplyMap('MapProducts',ProductID,'N/A') as Item  RESIDENT Order_table; 

drop table Order_table;

Not applicable
Author

indeed, I left aside the RESIDENT for the mapping load, excuses.

And true that, ProductID will be appearing if Order_table is not Dropped.

But indeed, if Order_table is dropped, I understand ProductID is not going to be shown through the ApplyMap.

It is used to ApplyMap but not kept.

thank you for the answers!