Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
In my model i load two tables:
Main:
LOAD
*
FROM
Example.xlsx
(ooxml, embedded labels, table is Sheet1)
;
Left join(Main)
load
*
from
Example.xlsx
(ooxml, embedded labels, table is Sheet2)
;
But in second table there more than one value for every (or some) Nomenclature_Id.
I need to join value from first rows for field Name;
Necessary result:
Nomenclature_Id | Name |
211 | Name1 |
234 | Name1 |
454 | Name1 |
456 | Name1 |
Use mapping load,
PFA
This is the script ypoi need
load
Nomenclature_Id, FirstValue(Name) as Name
from
Example.xlsx
(ooxml, embedded labels, table is Sheet2)
Group By Nomenclature_Id;
Have a look at this post Don't join - use Applymap instead
Name_Map:
mapping load
Nomenclature_Id, Name
from
Example.xlsx
(ooxml, embedded labels, table is Sheet2)
;
Data:
LOAD
Nomenclature_Id,
applymap('Name_Map', Nomenclature_Id) as Name
from
Example.xlsx
(ooxml, embedded labels, table is Sheet1)
;