Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

Combine multiple fields into a dimension

Hi,

I have a flat quantified table that I want to use a couple of fields to create a piechart.

OrderIDNumberOfProductXNumberOfProductYNumberOfProductZ
1232530
2342102

 

I want to create a piechart with dimension showing  X, Y & Z and how the percentage distribution between them.

X = 54,5%
Y = 27,2%
Z = 18,1% 

Any help is appreciated!

 

1 Solution

Accepted Solutions
Highlighted
Luminary
Luminary

Re: Combine multiple fields into a dimension

This worked for me:

Dim: 

 

=ValueList('X','Y','Z')

 

Msr: 

 

Pick(Match(ValueList('X','Y','Z'),'X','Y','Z'),
	Sum(NumberOfProductX),
    Sum(NumberOfProductY),
    Sum(NumberOfProductZ))

 

 

I would suggest combining the fields in the following way though for performance reasons. You can utilize the CROSSTABLE load for this.

Order IDProductQty
1232X5
1232Y3
1232Z0
2342X1
2342Y0
2342Z 2
Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

2 Replies
Highlighted
Luminary
Luminary

Re: Combine multiple fields into a dimension

This worked for me:

Dim: 

 

=ValueList('X','Y','Z')

 

Msr: 

 

Pick(Match(ValueList('X','Y','Z'),'X','Y','Z'),
	Sum(NumberOfProductX),
    Sum(NumberOfProductY),
    Sum(NumberOfProductZ))

 

 

I would suggest combining the fields in the following way though for performance reasons. You can utilize the CROSSTABLE load for this.

Order IDProductQty
1232X5
1232Y3
1232Z0
2342X1
2342Y0
2342Z 2
Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

Highlighted
Contributor

Re: Combine multiple fields into a dimension

Works very good, thanks!