Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Multiple Cross Tables?

Hello QlikViewGurus.

I need help from the experts here, since it's been ages since I wrote any script myself.

I have indata arranged like this:

ProductSales Price 2012Sales Price 2013Sales Price 2014Sales Volume 2012
Sales Volume 2013Sales Volume 2014Product Cost 2012Product Cost 2013Product Cost 2014
A234202025112

So What I want is three different crosstables, I guess.

Table One

Product,

Sales Price

Year

Table Two

Product,

Sales Volume,

Year

Table Three

Product

Product Cost,

Year

So how do I do this in a good way? So please help the QV-noob here.  Many thanks in advance

[Edit]I have attached my file now.

Best regards,

Jonas

Tags (1)
3 Replies
fdelacal
Valued Contributor

Re: Multiple Cross Tables?

I atach different ways that you can do it, is better you have all in the same table.

please se qvw atach.

hope that helps you regards.

Not applicable

Re: Multiple Cross Tables?

Big thanks for helping me out, but the problem for me is that I need to keep the format intact. So it need to look like that.

I tried to load different loads in my attached example but then I need to "clean up" the data. I have attached the files now.

Isn't there any neat trick to get this to look nice?

Regards,

Jonas

Not applicable

Re: Multiple Cross Tables?

RECORD:

CrossTable(RECORD, Data)

LOAD Product,

     [Sales Price 2012],

     [Sales Price 2013],

     [Sales Price 2014],

     [Sales Volume 2012],

     [Sales Volume 2013],

     [Sales Volume 2014],

     [Product Cost 2012],

     [Product Cost 2013],

     [Product Cost 2014]

FROM

[..\Data\Excel\CROSSTABLE1.xlsx]

(ooxml, embedded labels, table is Sheet1);

temp:

LOAD *,

Left(RECORD,Len(RECORD) -4)  AS RECORD2,

RIGHT(RECORD,4)  AS YEAR

Resident RECORD;

DROP Table RECORD;