Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Mapping Load with Crosstab

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.

11 Replies
mov
Esteemed Contributor III

Re: Mapping Load with Crosstab

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  :-(

Re: Mapping Load with Crosstab

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

));


talk is cheap, supply exceeds demand
Not applicable

Re: Mapping Load with Crosstab

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...

Not applicable

Re: Mapping Load with Crosstab

Thanks. I'll fall back on this if I can't get transpose to work...

Re: Mapping Load with Crosstab

Did you specify no labels as I did or do you still have embedded labels set?


talk is cheap, supply exceeds demand
Not applicable

Re: Mapping Load with Crosstab

Thanks. I tried both "no labels" and "explicit labels" -- same result.

"embedded labels" raises an error:

Field not found - <@1>

Re: Mapping Load with Crosstab

Post the excel file please. Or at least a file with the exact same structure.


talk is cheap, supply exceeds demand
Not applicable

Re: Mapping Load with Crosstab

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?

00_Main_for_QV.png

mov
Esteemed Contributor III

Re: Re: Mapping Load with Crosstab

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

Community Browser