Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmhmh91
Contributor
Contributor

Pivot Table data representation

Hi,

I have a question about Pivot table.

I have two tables like below:

Table A:

ItemIDGroupItem Value
a100A100
b100A110
c100B120
d100C130

Table B:

GroupGroup Value
A300
B500
C200

The relationship between Item and Group is like Child and Parent, but Item Value and Group Value are separate and has not relationship with each other. I now want a pivot table like below (under Group Value column, leave the cell blank instead of display Group Value of the Group):

Group / ItemItem ValueGroup Value
A210300
     a100100-
     b100110-
B120500
     c100120-
C130200
     d100130-
1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello Mandi,

Trust that you are doing good!

Please follow below steps to get the desired result:

1. Add Group & ItemID in used dimension list of Pivot table.

2. In Expression tab add below expressions

//Item Value

Sum([Item Value])

//Group Value

If(Dimensionality()=1, Sum([Group Value]), Null())

* Here we are making use of Dimensionality() function to check whether row is of type detail or summary and based on it we are populating the expression value.

3. Locate the Style tab of Pivot table chart object and select Indent Mode & Use Only First Dimension Label options (While doing this provide Group / Item as label to Group dimension on Dimension tab)

Also refer the sample application attached herewith.

Hope this will be helpful.

Regards!

Rahul

View solution in original post

3 Replies
rahulpawarb
Specialist III
Specialist III

Hello Mandi,

Trust that you are doing good!

Please follow below steps to get the desired result:

1. Add Group & ItemID in used dimension list of Pivot table.

2. In Expression tab add below expressions

//Item Value

Sum([Item Value])

//Group Value

If(Dimensionality()=1, Sum([Group Value]), Null())

* Here we are making use of Dimensionality() function to check whether row is of type detail or summary and based on it we are populating the expression value.

3. Locate the Style tab of Pivot table chart object and select Indent Mode & Use Only First Dimension Label options (While doing this provide Group / Item as label to Group dimension on Dimension tab)

Also refer the sample application attached herewith.

Hope this will be helpful.

Regards!

Rahul

mhmhmh91
Contributor
Contributor
Author

It works perfectly. Thank you, Rahul!

Best,

Mandi

rahulpawarb
Specialist III
Specialist III

Cheers,

Rahul