Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
flygstolen_fred
Creator
Creator

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
treysmithdev
Partner Ambassador
Partner Ambassador

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
treysmithdev
Partner Ambassador
Partner Ambassador

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
flygstolen_fred
Creator
Creator
Author

Works very good, thanks!