vladino wrote:Hi all,
we have created an application for web client with multiple views. These views are built upon multiple cubes with nearly the same dimensionality.
Is it somehow possible to fix context dimensions to use the same member for all of these views? Ie. when I select specific product in first view I want to have this product selected in all next views.
Actually there are two ways of doing this and they both involve subsets. One uses static subsets and the other dynamic. They both require you to create all the views you want adhering to this using subsets. In your example that is the Product dimension.
1) First option is a static subset. Create a static subset, let's call it Static_Products and give it one member, doesn't matter which. Now, when you create your views use this subset for the Product dimension selection. Now all the views will have this product. When a user opens that view and changes the subset, to select another product, as long as they save over the original subset then all the views will now point to the new product. The problem with this is that the users have to have the ability to save public subset, meaning they need admin privileges over the Product dimension. Not necessarily a good idea.
2) Second option is a dynamic subset. Create a control cube, let's call it Choice, that has two dimensions, Choice_Item (that has one "N" element called Product_Choice), and Measure_PC (that has one "S" element called Value). Store your choice of product in the intersection of Choice_Item and Value. Let's say we put "Widget" in there. Now, we create a dynamic subset called Dynamic_Products that we're going to use in the views we talked about needing in #1 above. The MDX query behind this subset would look like:
{TM1FILTERBYPATTERN( {TM1SUBSETALL( [Product] )}, [Choice].([Choice_Item].[Product_Choice],[Measure_PC].[Value]))}
Every view will now have "Widgets" as it's product. To change this all you have to do is replace "Widgets" with something else in the Choice cube. If you want to get fancy you can make the }Clients dimension part of this cube so that each client can have their own product selection. Then the MDX looks like this:
{TM1FILTERBYPATTERN( {TM1SUBSETALL( [Product] )}, [Choice].((STRTOMEMBER("[}Clients].["+USERNAME+"]"),[Choice_Item].[Product_Choice],[Measure_PC].[Value]))}
and the subset will evaluate to a different product depending on the user.