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

Joining tables with dublicate values

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_IdName
211Name1
234Name1
454Name1
456Name1
3 Replies
Not applicable
Author

Use mapping load,

PFA

alexandros17
Partner - Champion III
Partner - Champion III

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;

Colin-Albert

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)
;