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

show both totals and the percentage of total in pivot

WP_20141007_23_53_40_Pro.jpg

Dear Qlikview community,

I managed to replicate the white part of the screenshot attached in a Pivot table in Qlikview.

Some questions remain:

Can I add the total sum as well (G6) and add the totals per category as well?

Can I add share (%)  both on the X and Y-axis as well as highlighted in the Picture?

If yes, what would be the required steps?

Thanks a Million !

Rob

13 Replies
JonnyPoole
Employee
Employee

here is the load script i used .  1 main table and then 1 table for rows and 1 table for columns.  Table concatenation to build the rows and columns table.

Data:

LOAD Category,

     Customer,

     Values

FROM

(ooxml, embedded labels, table is Sheet1);

//Columns

ColumnsForPivot:

Load

  RecNo() as ColumnSortOrder,

  Customer,

  Customer as CustomerForPivot

Resident Data

order by Customer asc;

let vNumCustomers= NoOfRows('ColumnsForPivot');

Concatenate(ColumnsForPivot)

Load

  $(vNumCustomers)+1 as ColumnSortOrder,

  Customer,

  'Total' as CustomerForPivot

Resident Data;

Concatenate(ColumnsForPivot)

Load

  $(vNumCustomers)+2 as ColumnSortOrder,

  Customer,

  '% Share' as CustomerForPivot

Resident Data;

//Rows

RowsForPivot:

Load

  RecNo() as RowSortOrder,

  Category,

  Category as CategoryForPivot

Resident Data

order by Category asc;

let vNumCategories= NoOfRows('RowsForPivot');

Concatenate(RowsForPivot)

Load

  $(vNumCategories)+1 as RowSortOrder,

  Category,

  'Total' as CategoryForPivot

Resident Data;

Concatenate(RowsForPivot)

Load

  $(vNumCategories)+2 as RowSortOrder,

  Category,

  '% Share' as CategoryForPivot

Resident Data;

Not applicable
Author

thanks sir, this will require some study from my end as a rookie. I will check this and let you know, cheers !

Not applicable
Author

Thanks Antonio,

This would be one way to solve it, but I believe that it will confuse at least some people having 2 values in 1 cell...

Cheers !

Rob

Anonymous
Not applicable
Author

Here you go.

Kind regards

Niklas