Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load two header rows by Crosstable

Hi Guys

I have one Excel with two header rows, I want to use crosstable to load into QlikView.

The attachment is the source file, and the 'target' sheet is what I want.

Does someone could guide me how to achieve it.

Thx a lot.

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Check for empty rows e.g if Type (Column A) has text (see red below)

TMP3:

LOAD A as Type,

    applymap('MAP1',1) as Category,

    B,

    C,

    D,

    E,

    F,

    G

FROM

[16B Finance.xlsx]

(ooxml, no labels, table is '16B')

where recno() >2 and Len(A)>0;

View solution in original post

7 Replies
devarasu07
Master II
Master II

Not applicable
Author

Hi Devarasu R

I tried Stefan solution. However, after loding into QlikView, from table viewer, there's one row should not be existed.

Image 2.png

I marked in Red, do you know what's wrong with my script, thx.

stigchel
Partner - Master
Partner - Master

Check for empty rows e.g if Type (Column A) has text (see red below)

TMP3:

LOAD A as Type,

    applymap('MAP1',1) as Category,

    B,

    C,

    D,

    E,

    F,

    G

FROM

[16B Finance.xlsx]

(ooxml, no labels, table is '16B')

where recno() >2 and Len(A)>0;

passionate
Specialist
Specialist

Hi Ran,

PFA, solution.

Change the numeric value of date as required.

Regards,
Pankaj

effinty2112
Master
Master

Hi Xu,

We can do this in two steps. A transposition then crosstable.

Transpose:

LOAD F1 as Category,

     Date(Type,'YY/MM') as Date,

     [Application Biz],

     [DIRECT Biz],

     [Direct expense]

FROM

test.xlsx

(ooxml, embedded labels, table is test, filters(

Transpose()

));

CrossTable:

CrossTable(Type,Value,2) LOAD * Resident Transpose Where not IsNull(Date);

DROP Table Transpose;

gives this:

Type Date Value Category
Application Biz16/100.00Budget
Application Biz16/11773.96Budget
Application Biz16/122,268.69Budget
Application Biz17/01773.96Budget
Application Biz17/020.00Evaluate
Application Biz17/033,307.91Evaluate
DIRECT Biz16/100.00Budget
DIRECT Biz16/110.00Budget
DIRECT Biz16/12903.14Budget
DIRECT Biz17/010.00Budget
DIRECT Biz17/020.00Evaluate
DIRECT Biz17/03903.14Evaluate
Direct expense16/1036.00Budget
Direct expense16/1145.00Budget
Direct expense16/1241.00Budget
Direct expense17/0131.00Budget
Direct expense17/0226.00Evaluate
Direct expense17/0340.00Evaluate

Regards

Andrew

Not applicable
Author

Hi Piet

The table is right now. Thx!

Not applicable
Author

Hi Andrew

Seems your solution is better, no need to map anything.