# 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.

 OrderID NumberOfProductX NumberOfProductY NumberOfProductZ 1232 5 3 0 2342 1 0 2

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

## 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 ID Product Qty 1232 X 5 1232 Y 3 1232 Z 0 2342 X 1 2342 Y 0 2342 Z 2
Blog: WhereClause   Twitter: @treysmithdev
2 Replies
Highlighted
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 ID Product Qty 1232 X 5 1232 Y 3 1232 Z 0 2342 X 1 2342 Y 0 2342 Z 2
Blog: WhereClause   Twitter: @treysmithdev
Highlighted
Contributor

## Re: Combine multiple fields into a dimension

Works very good, thanks!