Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have 3 tables with
Table1:
Type, Segment,
A,
A,
A,
,B
,B
,B
Table2:
ID Type TypeData
1,A, 21
2,A,22
,,,,
,,,,
Table3:
ID Segment TypeData
1,B, 21
2,B,22
,,,,
,,,,
, No I want to see the values in a single table
like
ID Type Segment, TypeData, SegmentData
1,A,B,21,21
2,A,B,22,22
......
Is this possible ? if yes Please help me on this
Regards
John
You dont need the first table:
Fact:
LOAD ID,
Type,
Data as TypeData
FROM
[.\community4.xlsx]
(ooxml, embedded labels, table is Sheet2);
Left join(Fact)
LOAD ID,
Segment,
Data as SegmentData
FROM
[.\community4.xlsx]
(ooxml, embedded labels, table is Sheet3);
Hi,
try to give a look to the attached sample.
It depends on your requirement which kind of JOIN u are using (LEFT JOIN, JOIN ...).
The join prefix joins the loaded table with an existing named table or the last previously created data table. The join is a Natural Join made over all the common Fields. The join prefix may be preceded by one of the prefixes Inner, Outer, Left or Right. When DISTINCT predicate is used in a LOAD statement, the resulting table becomes distinct. Any data added to the table also becomes distinct, regardless if the data is concatenated or joined.
As Simen stated you do not neet table 1.
Cheers,
Patric
Thanks Simen Kind Glbrandsen,
Here You have taken only Two tables, But I want to take 3 tables in the sheet1 if I have 2 more data fields and I want those also how can we do that , please find the updated excel file.
Regards
John
There are no ID on the records in the first table. So which one of the Sold values do you want when a row has Type A?
Yes Your correct Simen Kind Glbrandsen, there I am getting problems,
Hi,
Try this approach
Fact:
LOAD
NULL() AS ID
,Type
,Segment
,NUll() AS TypeData
,Null() AS SegmentData
from sourcefile;
NoConcatenate
Table2:
ID Type TypeData
1,A, 21
2,A,22
from sourcefile:
concatenate(Table2)
Table3:
ID Segment TypeData
1,B, 21
2,B,22
from sourcefile;
Concatenate(Fact)
LOAD
*
Resident Tabel2;