Dynamic bucketing in ActivePivot - mdx

In our ActivePivot project, we have designed our cube with predefined hierarchies and levels. Among them, we have our currencies which all belongs to the same level.
Underlyings
|_ALL
|_UnderlyerCurrency
Our users would like to group those currencies, each group being possibly different based on user choice.
I know it is already possible to bucket/group members in ActivePivot using Analysis Dimension, but this is too static for our use case.
Is it possible to group those currencies per user ? is it possible to configure it without restarting the server ?
PS: we use Excel and ActivePivot Live as UI

Using MDX, it is possible to define bucket or group.
Here is a sample MDX that creates dynamically two buckets Europe and Asia in your existing hierarchy (I assume dimension and hierarchy have the same name) :
WITH
Member [Underlyings].[Underlyings].[ALL].[Europe] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[EUR],
[Underlyings].[Underlyings].[ALL].[AllMember].[GBP],
[Underlyings].[Underlyings].[ALL].[AllMember].[CHF]
}
)
Member [Underlyings].[Underlyings].[ALL].[Europe].[EUR] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[EUR]
}
)
Member [Underlyings].[Underlyings].[ALL].[Europe].[GBP] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[GBP]
}
)
Member [Underlyings].[Underlyings].[ALL].[Europe].[CHF] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[CHF]
}
)
Member [Underlyings].[Underlyings].[ALL].[Asia] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[JPY]
}
)
Member [Underlyings].[Underlyings].[ALL].[Asia].[JPY] AS Aggregate(
{
[Underlyings].[Underlyings].[ALL].[AllMember].[JPY]
}
)
SELECT NON EMPTY {
[Underlyings].[Underlyings].[ALL].[Europe],
[Underlyings].[Underlyings].[ALL].[Europe].[EUR],
[Underlyings].[Underlyings].[ALL].[Europe].[GBP],
[Underlyings].[Underlyings].[ALL].[Europe].[CHF],
[Underlyings].[Underlyings].[ALL].[Asia],
[Underlyings].[Underlyings].[ALL].[Asia].[JPY]
} ON ROWS
FROM [YourCube]
With ActivePivot Live, user can write their own MDX (you can't do it with Excel though).
Then the interface will be smart enough to give the user all regular controls (wizard manipulations, drill down, sort, filtering, ...) on this table. On top of that, they will be able to navigate in it as if it was a regular hierarchy !
If you don't want users to write their own MDX, you have two solutions :
have someone with enough MDX knowledge that will write those queries, save it in a bookmark that will be shared with non technical users
extend the interface to create your own UI that generate those buckets: non technical users will be autonomous

Related

How to go from rows to a hierarchy in icCube

I want to create a one-column hierarchy from multiple columns using mdx. I got this result:
from the Sales cube with this mdx:
SELECT
{ {[Measures].[Amount]} } ON COLUMNS,
{ [Customers].[Geography].firstNotAllLevel().allmembers }*{ [Product].[Product].[Category].allmembers }*{ [Time].[Quarter].firstNotAllLevel().allmembers } ON ROWS
FROM [Sales]
I want the first three columns to form a hierarchy that looks like this:
Is this possible in icCube using mdx? If it is, can you show me how?
Using standard MDX you can't solve the problem as you can not navigate across hierarchies on a single MDX statement.
What we're looking for is to define our own hierarchy for navigation. Using icCube you've two different ways :
1) You can use Categories to define at will a new hierarchy. Check documentation (categories-howto, categories-doc and categories-example ). Bear in mind that for the new hierarchy the parent / child relation is just visual and not data related (e.g. parent is the sum of his children)
2) You can define your navigation logic using the reporting tool. But this has his limitations in the current version 5.1 (most probably we will fix for 5.1.1)

Is it possible to select 2 measures in different axis in MDX?

I have a question regarding MDX queries :
I have a SUBSCRIPTION cube about magazine subscriptions with two measures : NEW SUBS. and RETURNING SUBS.
I'm trying to make a query that displays both measures for two periods of time, and also the percentage growth in the period.
Example :
DESIRED VIEW - EXAMPLE
But I can't get this view using standard MDX, because I can't put measures in both axis.
The result I've got so far (not user friendly):
Using measure ON COLUMNS:
RESULT - NOT USER FRIENDLY
How can I do that first view using MDX formulas?
Thanks in advance.
Make growth a member of your time hierarchy like this:
WITH MEMBER [Time].[Calendar Date].[Growth] AS
[Time].[Calendar Date].[Jan-12] / [Time].[Calendar Date].[Jan-13] - 1
,format_string="0%"
SELECT { [Time].[Calendar Date].[Jan-12], [Time].[Calendar Date].[Jan-13], [Time].[Calendar Date].[Growth] }
ON COLUMNS,
{ Measures.NEW, Measures.RETURNING }
ON ROWS
FROM [SUBSCRIPTION]
I was guessing some names of your cube, you will have to adapt the MDX to your situation.
Calculated members need not be a member of the measures hierarchy, they can be used on every hierarchy of your cube. And to answer the question in the title of your question: No, one hierarchy can only be used in one axis in an MDX query.

Writeback partition secuirty in SSAS

I have a writeback partition working pretty well in a cube. The users access it through Excel 2010. At the moment there are 3 measures in the cube. I'd like to only give users access to writeback to 2 of them while being able to read all 3. Is there a way to accomplish this? I'm very much an MDX novice if MDX is involved. Thanks in advance.
The failproof way to prevent those users from writing to your measure is by including those in a special Role with writeback access. In the tab "Cell Data", check the box "Enable read/write permissions", and in the field below "Allow reading and writing of cube content" you can set an expression to limit the write measures, such as:
(Measures.CurrentMember IS [Measures].[X] OR Measures.CurrentMember IS [Measures].[Y])
In the upper field, that enables read access, allow access to all three measures:
(
Measures.CurrentMember IS [Measures].[X] OR
Measures.CurrentMember IS [Measures].[Y] OR
Measures.CurrentMember IS [Measures].[Z]
)
They will have a weird message saying that the cell was blocked, but at least you'll prevent them from writing to your beloved measure.
Another approach would be: create a Calculated measure ([Measures].[ZZ]) based on the one you want to hide ([Measures].[Z]). SSAS won't let the user writeback on a calculated measure. Make sure you hide the original by marking it VISIBLE = 0.
#mmarie is correct...if the measures are all in the same partition, then you'll need to move the 2 for writeback into a separate measure group. You can do this by creating separate views in the relational DW or via named queries in the DSV. Since both measure groups will have the same dimensionality (because they are based on the same table) SSDT will give you a warning - just ignore it ;-)

Dimension hierarchy not showing all data

I have a users dimension, which represents the hierarchy of many shops. For instance, shops are split into Country - > Region -> Town/Village - > Actual Shop. So when you look at it from a hierarchy perspective, it is Level1, Level2, Level3, Level4 etc.
Now the strange thing is, if I execute the MDX query and filtering in the WHERE clause, by the hierarchy, for a specific user no data displays. However, if I execute the same exact MDX not filtering by the hierarchy, but filtering by the attributes, records are shown.
It is important to mention that the user hierarchy [UserIdHierarchy] contains a hierarchy of the following members
[UserLevel1Id]
[UserLevel2Id]
[UserLevel3Id]
[UserLevel4Id]
[UserLevel5Id]
These are the 2 cases, which should return exactly the same results...
Where clause filtering with user hierarchy :
where
(
DESCENDANTS([Dim User].[UserIdHierarchy].&[#12345],0, self)
)
Where clause filtering without user hierarchy :
where
(
DESCENDANTS([Dim User].[UserLevel3Id].&[#12345],0, self)
)
Why don't both of the filters, bring up the same data for this particular user?
The reason was that the User hierarchy was using historical approach. Therefore, when a user had more then one hierarchy (as shown below), for some strange reason the MDX got messed up and stood with the first item in the dimension hierarchy. Below, I am showing 3 different setups of a user, after his registration into the system. To fix my problem, instead of just doing
[Dim User].[UserIdHierarchy].&[#12345]
I'm filtering in the where clause all user members, i.e.
{[Dim User].[UserIdHierarchy].[UserLevel1Id].&[#12345],
[Dim User].[UserIdHierarchy].[UserLevel2Id].&[#12345],
[Dim User].[UserIdHierarchy].[UserLevel3Id].&[#12345]}
Then the actual filtering is done on the FACT data. This way I include all data for all members in the user hierarchy which match my user - which in this case was #12345.

SSAS Dynamic Security on Parent Child Hierachy

I'm using the following MDX Query to define the allowed member set in a dynamic security role over a parent child hierachy:
Generate(
NonEmpty (
[Business Unit].[Business Unit Key].[Business Unit Key].members,
(
[Measures].[AD Account Business Unit Count],
StrToMember("[AD Account].[AD Account Name].["+Username()+"]")
)
), {
LinkMember (
[Business Unit].[Business Unit Key].CurrentMember,
[Business Unit].[Business Units]
)
}
)
The MDX query returns as expected when I run it in SQL, and when I look at the 'Basic' tab in the role the correct attributes of the hierachy are selected automatically... all good.
However when I process and view this hierachy in the cube I can still see all of the attributes of the hierachy as if the dynamic security role isn't working at all.
Could you plea try to place the same code in default member, The dynamic security with the security level of both allowed and default members. Please let me know the solution
Turns out that the browser was just being buggy for some reason, if I process the cube and connect via Excel for example then everything works as expected