Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qv,
I'm facing problem with apply map.
I have following script :
Directory;
Tab1:
LOAD Id,
Product,
Sales
FROM
E:\Ananth_Works\Applymap.xlsx
(ooxml, embedded labels, table is Tab1);
Map:
Mapping load
Id,
Sales
Resident Tab1;
Directory;
Tab2:
LOAD OrderId,
Orders,
Quantity,
ApplyMap('Map',Id)*Quantity as Result
FROM
E:\Ananth_Works\app2.xlsx
(ooxml, embedded labels, table is Sheet1);
When I run this script I'm getting following error :
Field not found - <Id>
Tab2:
LOAD OrderId,
Orders,
Quantity,
ApplyMap('Map',Id)*Quantity as Result
FROM
E:\Ananth_Works\app2.xlsx
(ooxml, embedded labels, table is Sheet1)
Please help me whats wrong with this.
Thanks & Regards,
Ananth
Hi Anand,
I think, you are misleading here. It is not compulsory that the key field name to be same in both table in apply map.
Thanks
In the base table basically the field should be same
Ex:-
Map:
Mapping LOAD * Inline
[
Id,Desc
a,fsdf
b,saf
c,dfdsa
];
LOAD BaseId,Word,ApplyMap('Map',BaseId) as Description;
LOAD * Inline
[
BaseId,Word
a,23fd
b,45fdsf
c,3fsdf
d,56fdsf
e,566fsdf
];
Correct i am suggest for the base table not for Mapping table see the example below suggested by me in that table field name should be same not in mapping table. If it is same ok but not necessary always but good practice is should be same for understanding.
Regards
Anand
I don't know, but I tried with my scenario it is giving same result in both the cases.
i.e
Map:
Mapping Load
Id,
Sales
From Location;
TableName:
Load
OrderId,
Quantity
ApplyMap('Map',OrderId) * Quantity as Result
From Location;
Thanks,
Ananth