Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello. I'm trying to set up a mapping load using CROSSTAB. My source is an Excel file. What I need is to pull labels from the second line of the file and have those paired with the letter associated with the column. So my Excel file might look like this:
-: A | B | C | D | E...
1: [extraneous data]
2: Apple | Bonnie | Cherry | Danielle | Endive |
3: [extraneous data]
4: [extraneous data]
I need a mapping table of
A, Apple
B, Bonnie, etc.
My initial attempt (without the MAPPING LOAD) was something like this:
CrossTable(xColumn, xValue)
FIRST 63 LOAD * from [Main.xlsx](ooxml, explicit labels, table is Sheet1);
63 is the number of columns. This works but gives me a third column (in first position) which I don't need and prohibits it from becoming a MAPPING LOAD.
Can someone see a better way? Thanks.
Brian,
I recommend to separate these steps:
1 - crossatable load into a table.
2 - create map:
Map:
MAPPING LOAD DISTINCT
Field1,
Field2
RESIDENT table;
Regards,
Michael
Edit: missed MAPPING 😞
Try using the Transpose transformation instead:
MyMap:
mapping LOAD @1 as xColumn,
@3 as xValue
FROM
[Main.xlsx](ooxml, no labels, table is Sheet1, filters(
Transpose()
));
Thanks. TRANSPOSE() is a good idea. However, instead of the column headers and the second data row, this is giving me the first and third data rows...
Thanks. I'll fall back on this if I can't get transpose to work...
Did you specify no labels as I did or do you still have embedded labels set?
Thanks. I tried both "no labels" and "explicit labels" -- same result.
"embedded labels" raises an error:
Field not found - <@1>
Post the excel file please. Or at least a file with the exact same structure.
I don't see an option to upload -- but here's a masked version of the file. It's pretty straightforward. I need a mapping of:
M, Easy
N, Timely
O, Comprehensive
P, Accurate
Do I not have enough merit points yet to upload files?
It's not about the merit points... Click "use advanced editor", it is on the top right of the reply window. After this, you can see "attach" on the bottom right.
Regards,
Michael