Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
nenadvukovic
Contributor III

CrossTable is not enough, as far as I know. Do you know?

Hi,

If you have a table structured like this:

                         P1      P1      P2      P2

Customer      Volume Price Volume Price

ABC                100      10      200      11

DEF                300      20      400      21

using the CrossTable function, I can't get this:

Customer      Period     Volume Price

ABC                P1          100      10

ABC                P1          200      11

DEF                P2          300      20

DEF                P2          400      21

Thanks a lot

I get two unexpected rows and incorrect Price:

2018-06-23_12-01-55.jpg

2018-06-23_12-02-48.jpg

Message was edited by: Nenad Vuković

17 Replies

Re: CrossTable is not enough, as far as I know. Do you know?

May be check this out

multi_header_pivot_import.qvw

Re: CrossTable is not enough, as far as I know. Do you know?

PFA the sample script

Capture.PNG

nenadvukovic
Contributor III

Re: CrossTable is not enough, as far as I know. Do you know?

Thanks Sunny. My original table has this structure:

2018-06-22_16-30-25.jpg

I need first 9 dimensions to be available. Next 3 I ignore and then read values for 12 x 2 columns (Volume and Price).

Do I need to modify the provided script to handle this structure?

Thank you

Re: CrossTable is not enough, as far as I know. Do you know?

Change here

Capture.PNG

Add all the dimensions you need.

And add all the dimension here

Capture.PNG

nenadvukovic
Contributor III

Re: CrossTable is not enough, as far as I know. Do you know?

Yes, I realized that in the meantime. Thank you very much.

nenadvukovic
Contributor III

Re: CrossTable is not enough, as far as I know. Do you know?

Hi Sunny,

Can you please take a look into the updated initial post as I am getting strange results. Thx

Re: CrossTable is not enough, as far as I know. Do you know?

May be share your Excel file here for us to test

nenadvukovic
Contributor III

Re: CrossTable is not enough, as far as I know. Do you know?

Thanks for looking into this.

You can find a few lines in the attached file.

Re: CrossTable is not enough, as far as I know. Do you know?

See if this works