Hi All,
Currently banging my head against a brick wall trying to give the business a filtering mechanism in a Active Form.
I have a 3 Dimensional Cube:
Sales Channel: A, B, C
Product Prod1, prod2, Prod3...
Measures, DSR, SR, CV
Dependant on the drop down value that the user selects on the Active Form an appropriate MDX Expression is used for the Active Form. What I am struggling with at the moment is getting a certain MDX expression working.
For Example. The below expression will give me all Products which have a DSR Value of 10 or more in the cube. As the Sales Channel is not defined is seems to total the sales channel up and only return products with a total DSR value of 10 or mroe against the sum of all Channels.
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product] )}, 0)},[MyCube].([Measures].[DSR]) >= 10 )}
What I actually need to show is all Products with a DSR value of 10 or more against any channel. I know I can have multiple statements hard coding the channels into them and then having a union and a distinct wrapper but is there a better way of doing it?
Active Form MDX Filter Query
-
- Community Contributor
- Posts: 110
- Joined: Thu Aug 26, 2010 7:41 am
- OLAP Product: TM1, PA
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: North West England
Active Form MDX Filter Query
Always Open to Opportunities
-
- MVP
- Posts: 3704
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Active Form MDX Filter Query
I think for what you want to work you need to bring channel as a row dimension.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Active Form MDX Filter Query
Create an MDX query for the Sales Channel, just like the one you have for the Products, and then put them together using INTERSECT:
{
INTERSECT(
FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product] )}, 0)}, [MyCube].([Measuress].[DSR]) > 10 ) ,
FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales Channel] )}, 0)}, [MyCube].([Measures].[DSR]) > 10 )
)
}
{
INTERSECT(
FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product] )}, 0)}, [MyCube].([Measuress].[DSR]) > 10 ) ,
FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales Channel] )}, 0)}, [MyCube].([Measures].[DSR]) > 10 )
)
}
-
- Community Contributor
- Posts: 110
- Joined: Thu Aug 26, 2010 7:41 am
- OLAP Product: TM1, PA
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: North West England
Re: Active Form MDX Filter Query
Thanks Tomok:
Here is what I tried:
{INTERSECT({FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)},
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Channels_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
)}
This was created in the Product_Dim Dimension. I got an error message saying "INTERSECT: Sets have incompatible dimensionality".
I can definitely see your logic but can understand the error message as the second statement is retrieving sales channels back and not products. Is there possibly a way to use the GENERATE function to pass in each channel into the following:
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
to get what i need.
Thanks
Here is what I tried:
{INTERSECT({FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)},
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Channels_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
)}
This was created in the Product_Dim Dimension. I got an error message saying "INTERSECT: Sets have incompatible dimensionality".
I can definitely see your logic but can understand the error message as the second statement is retrieving sales channels back and not products. Is there possibly a way to use the GENERATE function to pass in each channel into the following:
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
to get what i need.
Thanks
Always Open to Opportunities
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Active Form MDX Filter Query
Well, you said this was related to an Active Form so I thought you were using this in the report itself, not creating a dynamic subset in the dimension. You can't save that code in the Product dimension because it references Sales Channel. Suggest you try lotsaram's suggestion.MSidat wrote:This was created in the Product_Dim Dimension. I got an error message saying "INTERSECT: Sets have incompatible dimensionality".
-
- Community Contributor
- Posts: 110
- Joined: Thu Aug 26, 2010 7:41 am
- OLAP Product: TM1, PA
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: North West England
Re: Active Form MDX Filter Query
Hi Tomok,
I am indeed using the MDX Expression as my last argument in the TM1RPTROW formula, but though I will try it in the subset first. Nevertheless it does not appear to work in the Formula as well, brings back no data.
Appreciate your comments on how this could be applied on the Active Form.
Understand the suggestion from Lotsaram but the data does not really lend it self to being in that format.
I am indeed using the MDX Expression as my last argument in the TM1RPTROW formula, but though I will try it in the subset first. Nevertheless it does not appear to work in the Formula as well, brings back no data.
Appreciate your comments on how this could be applied on the Active Form.
Understand the suggestion from Lotsaram but the data does not really lend it self to being in that format.
Always Open to Opportunities
-
- Posts: 74
- Joined: Thu Jun 17, 2010 10:35 am
- OLAP Product: TM1
- Version: 9.4 9.5.1
- Excel Version: 2003 - 2007
Re: Active Form MDX Filter Query
Hi Sidat,
I'm afraid you can't achieve your subset like that.
If you skip a dimension in a cube reference, the MDX query take the first element of this dimension.
But you can easely do it with an extra cube and some rules.
A copy of your cube with some rule like
Then your filter can stay on sum of channels in this extra cube.
I'm afraid you can't achieve your subset like that.
If you skip a dimension in a cube reference, the MDX query take the first element of this dimension.
But you can easely do it with an extra cube and some rules.
A copy of your cube with some rule like
Code: Select all
[Stock Remaining]=IF( DB( 'Stock Commitment Cube' , ... 'Stock Remaining' ) >= 500 , 1 , 0 )
-
- Community Contributor
- Posts: 110
- Joined: Thu Aug 26, 2010 7:41 am
- OLAP Product: TM1, PA
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: North West England
Re: Active Form MDX Filter Query
Thanks for the replies.
I managed to get a suitable MDX Query working by using the following Generate Statement:
{Generate(
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Channels_Dim])}, 0)},
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
)}
In effect the Generate Statement is running the following MDX:
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
Against each nodal element of the Sales_Channel_Dim. Furthermore I have wrapped the whole statement in a Distinct and TM1Sort and as its not a massive cube the results are back within a second or 2.
This Statement on the active form combined with drop down selections for the user to select various filtering measures is allowing a dynamic filtering ability in TM1Web where Excel Auto Filters do not work.
I managed to get a suitable MDX Query working by using the following Generate Statement:
{Generate(
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Channels_Dim])}, 0)},
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
)}
In effect the Generate Statement is running the following MDX:
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product_Dim] )}, 0)},
[Stock Commitment Cube].([Stock_Commitment_Version].[Current],[Stock_Commitment_Measure].[Stock Remaining]) >= 500)}
Against each nodal element of the Sales_Channel_Dim. Furthermore I have wrapped the whole statement in a Distinct and TM1Sort and as its not a massive cube the results are back within a second or 2.
This Statement on the active form combined with drop down selections for the user to select various filtering measures is allowing a dynamic filtering ability in TM1Web where Excel Auto Filters do not work.
Always Open to Opportunities
Re: Active Form MDX Filter Query
Hello,
I have similar scenario and i am using above MDX query mentioned by you in active form in the MDX subset section. It is not giving me any data.
Thanks
I have similar scenario and i am using above MDX query mentioned by you in active form in the MDX subset section. It is not giving me any data.
Thanks