Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
[SalesHeader]:
LOAD [col1],
[col2],
[col3]
FROM [lib://Desktop/x2.xlsx]
(ooxml, embedded labels, table is Sheet1);
below is Data
col1 | col2 | col3 |
Sales Value | Sales Qty | Net Sales |
[SalesData]:
LOAD ,
,
FROM [lib://Desktop/x1.xlsx]
(ooxml, no labels, table is Sheet1);
Sample Data without header now.
123 | 43 | 80 |
124 | 42 | 82 |
125 | 41 | 84 |
126 | 40 | 86 |
I want to give the header such as col1 header will be SalesHeader table first column i.e col1 value like that all.
Sales Value Sales Qty Net Sales
123 | 43 | 80 |
124 | 42 | 82 |
125 | 41 | 84 |
126 | 40 | 86 |
Is it possible friends?? please suggest me. Thanks,
Bibhuti
Try:
[SalesData]:
LOAD
as YourColumnName2,
FROM [lib://Desktop/x1.xlsx]
(ooxml, no labels, table is Sheet1);
IS the Excel file your loading from have the column headers as col 1, col 2 etc with the values under them? If so you can skip the 1st line like this,
(ooxml, embedded labels, header is 1 lines, table is Sheet1);
or
you can use the rename function with a mapping load:
FieldNameMap;
Mapping Load OldFieldName, NewFieldName From FieldNames ;
Rename Fields using FieldNameMap;
We can not write direct Query based on SalesHeader column name ??
Suppose I am loading SalesData table there Can it be possible to Assign column name as SalesHeader column values ??
[SalesData]:
LOAD
, // Here I want assign column name will be SalesHeader Column value
,
FROM [lib://Desktop/x1.xlsx]
(ooxml, no labels, table is Sheet1);
Is it possible??
Try:
[SalesData]:
LOAD
as YourColumnName2,
FROM [lib://Desktop/x1.xlsx]
(ooxml, no labels, table is Sheet1);
I am not sure I understand fully. How would you write the query to extract your data? From here I may be able to assist.