Flattened row set based on more than one dimension -
09-09-2004
, 03:22 PM
Hi,
I have a cube with 3 dimensions: Dim1, Dim2, Dim3 based on a fact
table containing users transaction details
Dim1 has two levels : level1, Level2
Dim2 and Dim3 has one level
Iam using the below query to get each users transacted amount over the
last two months based on dim1, dim2 and dim3.
With Member Measures.PeerGroup As
'[Dim1].currentmember.parent.parent.uniquename'
select {
Measures.[PeerGroup], Measures.[amt], Measures.[Count]} on
columns,
{nonEmptyCrossjoin([dim1].[Id].members, [dim2].members,
[dim3].[trantype].members)}
Dimension PROPERTIES [Id].Name + [dim2].[Type].Name +
[dim3].[trantype].Name on rows
from tobtest where ([trandate].&[2004].&[3].&[8])
I get the following result:
cust1 Type1 trantype1 [dim1].[all cust].[finservices].[] 10000 1
Type1 trantype2 [dim1].[all cust].[finservices].[] 9000 1
Type1 trantype3 [dim1].[all cust].[finservices].[] 2000 1
cust2 Type1 trantype1 [dim1].[all cust].[finservices].[] 10000 1
Type1 trantype2 [dim1].[all cust].[finservices].[] 9000 1
Type1 trantype3 [dim1].[all cust].[finservices].[] 2000 1
I would like to concatenate the [dim2].[type].name,
[dim3].[trantype].Name with peergroup and return result set as
follows
cust1 [dim1].[all cust].[finservices].[];Type1;trantype1
10000 1
[dim1].[all cust].[finservices].[];Type2;trantype2 9000
1
[dim1].[all cust].[finservices].[]Type3;trantype3 2000
1
cust2 [dim1].[all cust].[finservices].[];Type1;trantype1
10000 1
[dim1].[all cust].[finservices].[];Type2;trantype2 9000
1
[dim1].[all cust].[finservices].[]Type3;trantype3 2000
1
Is this possible to do.
I appreciate any help.
Thanks |