MDX Filter on cube by values
Posted: Mon Oct 24, 2016 7:26 am
Hi All,
I want to do a filter on an active form with 2 TM1RPT row dimensions to find out the list of combinations that match a string value in the cube.
Cube name : test
Dimensions: Dim1, Dim2, Dim3, Dim4,Dim5, Dim6, Dim7 and Test Measures.
Example data in Cube:
Dim1 Dim2 Type
Name1 D1 Active
Name2 D2 Active
Name3 D3 Inactive
Name4 D3 Active
I have used the below code, and as you can see expect Dim 1 and Dim2 all the other dimensions have value at a fixed element. I want to find out the elements from Dim1 which has type set to Active by considering all Elements from Dim2.
I wasn't sure how to omit Dim2 or Add "!" function in MDX similar to the one we have in rules and hence used Dim2. Current member.
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dim1] )}, 0)},[test].([Dim2].CurrentMember,[Dim3].[E1],[Dim4].[E2],[Dim5].[E3],[Dim6].[E4],[Dim7].[E5],[Test Measures].[Type]) = "Active")}
Expected Result after applying MDX:
Dim1 Dim2 Type
Name1 D1 Active
Name2 D2 Active
Name4 D3 Active
Please let me know if the above result can be achieved..
Thanks in Advance!
I want to do a filter on an active form with 2 TM1RPT row dimensions to find out the list of combinations that match a string value in the cube.
Cube name : test
Dimensions: Dim1, Dim2, Dim3, Dim4,Dim5, Dim6, Dim7 and Test Measures.
Example data in Cube:
Dim1 Dim2 Type
Name1 D1 Active
Name2 D2 Active
Name3 D3 Inactive
Name4 D3 Active
I have used the below code, and as you can see expect Dim 1 and Dim2 all the other dimensions have value at a fixed element. I want to find out the elements from Dim1 which has type set to Active by considering all Elements from Dim2.
I wasn't sure how to omit Dim2 or Add "!" function in MDX similar to the one we have in rules and hence used Dim2. Current member.
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dim1] )}, 0)},[test].([Dim2].CurrentMember,[Dim3].[E1],[Dim4].[E2],[Dim5].[E3],[Dim6].[E4],[Dim7].[E5],[Test Measures].[Type]) = "Active")}
Expected Result after applying MDX:
Dim1 Dim2 Type
Name1 D1 Active
Name2 D2 Active
Name4 D3 Active
Please let me know if the above result can be achieved..
Thanks in Advance!