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

Book - Qlikview 11 for developers - Problem in pivot table

Page 355

I am measuring load factor, ie number of passengers in plane vs seats in plane. In my table its often > 100, which is impossible. Moreover, my table does not even look like the one in the book. Where could I be making mistakes ?

My stuff -

My.JPG.jpg

Book -

Capture.JPG.jpg

1 Solution

Accepted Solutions
cfz
Former Employee
Former Employee

Hi John Wayne,

Regarding the aspect of the tables one big difference is that the one in the book has some columns pivoted (Year and Month) while yours doesn't

In QlikView, pivoting is done by dragging and dropping with the mouse. Just point the mouse somewhere in the

field, click and drag it to the desired position. While a field is being moved, its borders

are highlighted in blue.

Before doing this please check the Allow Pivoting check box in the Chart Properties: Presentation. It needs to be checked for the pivoting to work.

Regarding the numbers, if you upload the qvw file I could have a look and try to explain the differences.

Regards

Carlos

View solution in original post

7 Replies
arsal_90
Creator III
Creator III

Can u share your qvw file.

cfz
Former Employee
Former Employee

Hi John Wayne,

Regarding the aspect of the tables one big difference is that the one in the book has some columns pivoted (Year and Month) while yours doesn't

In QlikView, pivoting is done by dragging and dropping with the mouse. Just point the mouse somewhere in the

field, click and drag it to the desired position. While a field is being moved, its borders

are highlighted in blue.

Before doing this please check the Allow Pivoting check box in the Chart Properties: Presentation. It needs to be checked for the pivoting to work.

Regarding the numbers, if you upload the qvw file I could have a look and try to explain the differences.

Regards

Carlos

swuehl
MVP
MVP

One difference is that you haven't pivotted your Year and Month dimension to the top (just by drag & drop), as described on top of page 356.

The other issue is hard to guess without knowing your setting (expressions, chart settings, data you've used).

You can download the sample solution .qvw files from PacktPub site and compare with your file.

Not applicable
Author

@Carlos Fernández . Thanks ! So, I still have a lot to learn. I attached a copy of my qlikview file. Can you please help me to find the error ?

cfz
Former Employee
Former Employee

Hi John,

The problem was that the expression used to calculate the variable eLoadFactor was the wrong one. Instead of Sum([# Departures Performed]) / Sum([# Departures Scheduled])) it should be Sum([# Transported Passangers]) / Sum [# Available Seats])), Changing this in the variable overview and pivoting also the Year dimension you get the expected table.

Regards

Carlos

Not applicable
Author

Thank you very much ! The variable should be = (Sum([# Transported Passengers]) / Sum ([# Available Seats]))

Btw, how do I remove those pivoted columns and go back to the original "look" (ie first pic in my question) ? Also,

the text in cells is black. So, I cannot clearly see the text in blue cells. How do I make it white ?

cfz
Former Employee
Former Employee

You can get the original table in the same way that you did for pivoting but the other way around. That is, point the mouse somewhere in the

field, click and drag it to the desired position. While a field is being moved, its borders

are highlighted in blue. It can be a bit tricky the first couple of times before you get used. Of course the Allow Pivoting check box in the Chart Properties: Presentation needs to be checked for the pivoting to work.

To change the color of the text in some cells you should put an expression similar to the one you have used to change the background color but this time in the text color section under the expression.