Skip to main content
Announcements
Qlik Announces Qlik Talend Cloud and Qlik Answers: LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Cross table is not working

Hi,

I loaded a table from Excel file which looks like:

Company     2008     2009     2010     2011

ABC               10         20        5          3

CDE               5           10        3          2

Data:

CrossTable(year, Data)

LOAD Company,

     2008,

     2009,

     2010,

     2011

FROM

(biff, embedded labels, table is [revenue& Ops$]);

When I applied Cross table from the Edit script. I was able to see the values right. but after loading it and trying to use it in the qvw..it shows me the  

both fields Years and Data with the value of the years

Years     Data

2008     2008

2009     2009

2010     2010

2011     2011

Any Idea or help?

Thxs,

1 Solution

Accepted Solutions
cesaraccardi
Specialist
Specialist

Hi,

this happens because QlikView generates the load script without the brackets in the field names making them constant values "2008", "2009" for all the rows. Try with the brackets, like this:

Data:

CrossTable(year, Data)

LOAD Company,

     [2008],

     [2009],

     [2010],

     [2011]

FROM

(biff, embedded labels, table is [revenue& Ops$]);

Regards,
Cesar

View solution in original post

4 Replies
Not applicable

Like this?

Kiran.

cesaraccardi
Specialist
Specialist

Hi,

this happens because QlikView generates the load script without the brackets in the field names making them constant values "2008", "2009" for all the rows. Try with the brackets, like this:

Data:

CrossTable(year, Data)

LOAD Company,

     [2008],

     [2009],

     [2010],

     [2011]

FROM

(biff, embedded labels, table is [revenue& Ops$]);

Regards,
Cesar

bgerchikov
Partner - Creator III
Partner - Creator III

Try this one as well:

Directory

;

CrossTable(Year, Data, 1)

LOAD *

FROM

[..\Documents\QlikView\Tutorial\TestCross.xlsx]

(
ooxml, embedded labels, table is Sheet1);

alec1982
Specialist II
Specialist II
Author

perfect. all the above helped.

Thxs,