I know I can do this (quick example off the top of my head):
WITH
Member Measures.AnotherDataColumn AS [MyDimension].CurrentMember.Properties("MyProperty")
SELECT
{
Measures.DataColumn,
Measures.AnotherDataColumn
} ON COLUMNS
{
[MyDimension].Item
} ON ROWS
But is there a way to include that same calculated member Measures.AnotherDataColumn in the ROWS dimension?
Thanks in advance!!
You can create calculated members in any dimension, not just the measures dimension, but then you need to tell SSAS how you want it to aggregate the measures. Typically this is aggregating a set of other members from the same dimension and you see something like the following using the Aggregate function:
WITH
Member MyDimension.CalcMember AS Aggregate({[MyDimension].Item1:[MyDimension].Item3})
SELECT
{
Measures.DataColumn,
} ON COLUMNS
{
[MyDimension].Item
} ON ROWS
Related
I have two measures in cube. I want to add two values from each measure and showing into one measure. basically adding two measure values into one.
How can I do.
thanks
To create a new measure which sums two other measures:
WITH MEMBER [Measures].[MyNewMeasure] AS [Measures].[MyFirstMeasure] + [Measures].[MySecondMeasure]
SELECT {[Measures].[MyNewMeasure]} ON COLUMNS,
{ whatever } ON ROWS
FROM [CubeName]
just wondering if you could explain to me why these two mdx statements yield different results, and how I would alter the calculated measure to be correct. I am assuming the calculated measure is incorrectly using the sum function.
SELECT
{
[Measures].[PPPH]
}
ON COLUMNS,
{
[Matter].[Parent Matter Lawyer - Responsible].&[qnas]
}
ON ROWS
FROM [Expert Hypercube]
WHERE
(
[Date].[Fiscal].[Month].&[201702],
[Relative Period].[Relative Period].&[YTD]
)
versus
with
member measures.[PPPHx] as
sum({{linkmember([Timekeeper].[Person].currentmember,[Matter].[Parent Matter Lawyer - Responsible])}},measures.[PPPH])
select
{
measures.[PPPHx]
} on columns,
{
[Timekeeper].[Person].&[qnas]
} on rows
from [Expert Hypercube]
where
(
[Date].[Fiscal].[Month].&[201702],
[Relative Period].[Relative Period].&[YTD]
)
It's unclear why do you use Sum function at all. LinkMember function returns a member, no need to cover it with {...} like a set. Also you need to use the All member, since it returns [Timekeeper].[Person].CurrentMember + LinkMember([Timekeeper].[Person].CurrentMember,[Matter].[Parent Matter Lawyer - Responsible]).
With
Member [Measures].[PPPHx] as
(
LinkMember([Timekeeper].[Person].CurrentMember,[Matter].[Parent Matter Lawyer - Responsible]),
[Timekeeper].[Person].[All],
[Measures].[PPPH]
)
See a Richard Lees's article about it.
I have an MDX query that is filtering on a particular member, but I need it to return the actual member value as well.
For example:
SELECT NON EMPTY { [Measures].[__No measures defined] } ON COLUMNS, NON EMPTY { ([Archive].[SiteId].[SteId] }ON ROWS FROM [Model] WHERE ( {[Archive].[SiteId].&[{e7672ff4-7f0c-4806-8453-744a17bde4ca}],[Archive].[SiteId].&[{bb7d8f41-c88a-4bcb-ade8-d0533190185a}],[Archive].[SiteId].&[{04cd27b6-e239-4d27-bc58-27f0a8733193}]} )
so in SQL it would basically be -
Select SiteId from Model where SiteId In .....
However this won't work because it says the SiteId Member is already contained in the filter and so appear twice in the query!
So how can filter on SiteId AND return the SiteId?
Thanks!
I decided to use DAX instead. In fact DAX enabled me to perform some better manipulation given my data that sped up the overall application.
I want to calculate the daily number of children as a measure in SSAS. The logic should be written in SQL as follows:
Select Count(distinct ChildID)
From Child
Group by CurrentDate
How could I translate this script into MDX for calculation? I'm new to SSAS.
It depends a lot on how your dimensions are set up but shooting from the hip you could set up a measure that is a count of childid. To do that in SSAS under the cube structure create a new measure and select count under the usage property and the proper table under the source table. You could call this measure Child Count or something like that.
With a distinct child count measure set up the MDX would be something like this:
SELECT NON EMPTY
{ [Measures].[Child Count] } ON COLUMNS,
{ ([Dim Child].[CurrentDate].[CurrentDate].ALLMEMBERS ) } ON ROWS
FROM [Your Cube]
We are using hyperion, but this simeple mdx caused the error:"unknown-member measures.unit_name used in query".
why? Is "Measures" available in hyperion? Or do we need enable it?
Please help.
WITH MEMBER [Measures].[Unit_Name] AS '[Organization].currentmember.member_name'
SELECT {
[Measures].[Unit_Name]
} on columns,
{
[organization].[40-00012].members
} on rows from OPEXDSH3.OPEXDSH3
I suppose you want to retrieve the Organizatios catalog,
Did you try using DIMENSION PROPERTIES syntax?
Select
{[Measures].DefaultMember} On Columns,
{[organization].[40-00012].members} DIMENSION PROPERTIES MEMBER_NAME, MEMBER_KEY On Rows
From OPEXDSH3.OPEXDSH3