We're using Tableau with MSAS as datasource which requires us to use Calculated Members for specific measures etc.
In MDX you can create Set's and in Tableau's Calculated Members there is an option to choose Result type: Set.
However, I cannot find any documentation or practical examples how this is supposed to be used.
Has anyone tried it and how? Or does someone know how to use it and can share an example?
Is it the same as 'Create Set' in MDX?
Related
I have a requirement where report should show measures as "not applicable" if one selects a attribute which is not linked to that measure Group.
1) unrelateddimesnion= 'false' is not solving my problem because i have few default members.
2) I could able to show measure value as "not applicable " by Writing this MDX statement
([Customer].[customer name].[customer name], [measures].[sales forecast]) = 'not applicable'
but with this i have to repeat the same line for each and every attribute present in the dimension ( and also for each and every measure present in the measure Group)
can someone help me Writing the MDX for entire dimension instead for individual attribute. Thanks in advance.
Kind Regards
Mah
Bad news! An MDX script on your cube can't reference such a sub-cube in a simple way. You may have seen the LEAVES(dimension) function for a scope statement but that won't work when one attribute in a dimension has the [All] level and another has a selection. (That is to say the function returns the leaves of the dimension's key attribute). What you can do is use nested scope statements with the outer one filtering down to the list of measures you want to affect. That will at least save you typing a formula num_attributes * num_measures times. The scope statement may even accept the MEASUREGROUPMEASURES function. (When I last used that it only returned visible measures but that's probably what you want anyway.)
It may be easier to link measure group and dimension and let your data sit on the UNKNOWN member. (Or an explicit dummy member.) Then filters against or slices to real customer hierarchy values will exclude your [Sales Forecast] rows and show it as null. That's not something I've done and it'll have ramifications for error processing and you'll have to allow users sight of the unknown or dummy member. So recommend you play with the idea before you rely on it.
I hope this helps some.
I am creating a Dashboard using as a visualization a heat map. Everything was OK until I changed the parameters of my metric, the chart disappeared and I've got this message: 'Filter excludes all data'
The only modification that I've done is to set the Include Distinct Elements to true within the Count Parameter option of the metric.
What could be happening?. Do I need to set another parameter to get the count of distinct elements that I need?
Regards.
surely the metric is level with some attribute that is not inside the visualization, if the filter has date for example, include it in the visualization.
"Filter Excludes All data" is a default warning message that you will get in MicroStrategy when a reports/visuals/dashboards does not return any data.
https://community.microstrategy.com/s/article/KB47557-How-to-Properly-Suppress-the-Message-Filter-excludes-all?r=1&Component.reportDeprecationUsages=1&Headline.getInitData=1&ArticleView.getArticleHeaderDetail=1&Quarterback.validateRoute=1&RecordGvp.getRecord=1&ArticleRichContent.getArticleAuthor=1&ArticleTopicList.getTopics=1&ArticleRichContent.hasArticleAccess=1&ForceCommunityFeed.getModel=1&ArticleRichContent.getTopicsAssigned=1
There are n number of reasons for a report which cannot return data, please check the following steps to debug the issue,
As per your first image it shows a date range as filter, after you have changed to "Include only distinct" this date range might get affected so please put the objects in grid and apply the date filter and check whether it returns the correct data.
If it returns, check whether all the metrics returns a value.
Check whether candidateID, date and people attributes/metrics are properly related.
These steps will show, where the problem is, still if you could not figure it out export the dashboard and share it with MicroStrategy Tech Support team for debugging.
Hope it helps.
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 ;-)
I am relatively new to this depth of MDX, but here is my dilemma. My goal is to implement a calculated member using a .Net Stored Procedure. The calculation (XIRR) will be based on a set of cash flow dates and cash flow amounts. Ideally this would be a calculation in my cube that is available as a measure to Excel/Browser users.
So to start simple I am just trying to implement my own COUNT calculated member/measure (not even using .Net) to say count the # of members in a given dimensions based on the current context. So lets say I have a dimensions Customer with a Customer Id Key. And let's say there are a total of 100 customers in my database. So Count(Customer.CustomerId.AllMembers) would be 100. Now when you start using the browser and say filter on Customer.CustomerId.&1, Customer.CustomerId.&2 (customer id 1 and 2) I would expect my count calculated member to return 2 but it returns the total 100 count. I have tried using exists. I am sure there is something that I am just fundamentally not understanding yet.
Hopefully this makes sense, would hugely appreciate any help from someone that has a good understanding of SSAS/MDX and calculations. Thanks in advance.
Marty
You may have some issues here, I did when I tried to do a similar thing.
Your calculated member is not honouring the client sub-select, which is normal. What in theory you would do is create a dynamic set, and then use that in the calculated member to force the dimension count to be evaluated in the context of the subcube your filters have created. Mosha has a good article here: http://sqlblog.com/blogs/mosha/archive/2007/08/25/mdx-in-katmai-dynamic-named-sets.aspx
So you'd end up with something like:
CREATE DYNAMIC SET CurrentCube.Customers AS
EXISTING(Customer.CustomerId.CHILDREN);
CREATE MEMBER CurrentCube.Measures.CustomerCount AS
Customers.COUNT
Now the real problem you'll have is a bug in SSAS https://connect.microsoft.com/SQLServer/feedback/details/484865/calcuated-member-with-a-reference-to-dynamic-named-set-kills-the-cubes-performance so the code above, which will probably work just fine locally, will kill a production cube. This was an exciting learning experience for me.
See if you can get any of the workarounds to work, I couldn't.
I was able to get what I wanted, but I had to create query-scoped dynamic sets as part of the MDX query, I wasn't able to create it as a cube object:
WITH DYNAMIC SET Customers AS
EXISTING(Customer.CustomerId.CHILDREN);
MEMBER Measures.CustomerCount AS
Customers.COUNT
SELECT
Measures.CustomerCount
ON COLUMNS
FROM [Cube]
WHERE Customer.CustomerId.&[1]
Let us know how you get on.
I have a cube with some dimensions. There I have a dimension 'Product' which has some attributes and user defined hierarchies hidden. I do not know which attributes are hidden.
Is there a way to write an MDX to get the invisible attributes and user defined hierarchies?
I can get the name by other ways. But I want to know the way to get using MDX.
http://msdn.microsoft.com/en-us/library/ms145613.aspx gives an example query that reveals a member property:
WITH MEMBER [Measures].[Product List Price] AS
[Product].[Product].CurrentMember.Properties("List Price")
SELECT
[Measures].[Product List Price] on COLUMNS,
[Product].[Product].MEMBERS ON Rows
FROM [Adventure Works]
I cannot test it myself right now, but I assume that you could also write .Properties(0) or .Properties(1) to refer to properties by index, since you don't know the names. I'm not sure if there is a way to then discover the property name from the resulting cellset or not, sorry.
I'd start with looking into the DMVs for this, as you're really after metadata, not data.
http://dwbi1.wordpress.com/2010/01/01/ssas-dmv-dynamic-management-view/
They look like SQL, but run in the MDX window of SQL Management Studio, so will also run in an MSOLAP connection.
SELECT * FROM $system.mdschema_properties
That looks to be the query, a full list of members and a column identifying which are visible.
See how that works out for you.