Differences between cube measures and mdx measures - mdx

is there a difference between a native cube measure (for example Measure1) and this mdx measure :
Measure2=[Measures].[Measure1] ?
Because when I use these measures together I dont get any results, and when I use them one by one I get what I want.

So the Cube Measures are present at the time of cube processing where the "MDX measures"(correct name is calculations) are determined at the query time. You should try to use the Cube measures where ever possible.
Secondly they can be easily used together.

Related

SSAS OLAP Cube - Sum measure only works when keys are present

(This is a mock of my actual setup to help me figure out the problem.)
I have one fact table and one dimension table, linked by an id field.
My goal is to make a measure that sums up all "thing_count" (integer) values in my cube.
If the user splits by nothing, it should show the total "thing_count" for all records in the fact table. If it's split by "category_name" from the dimension, it should show the total "thing_count" for each category.
I tried to achieve this by creating a SUM measure in my cube:
It works, but not in the way I intend it to
It always shows (null) unless I drag in the "id" field from the dimension.
Measure only:
Measure and category:
Measure, category, and id:
How can I make the measure show the value without keys needing to be present?
Edit:
For GregGalloway's request (I've edited the names so the screenshots are easier to follow):
One common explanation for this behavior (no aggregation) is that you have inadvertently commented out the CALCULATE; statement in your MDX script in the cube. Please check that statement is still present.

Sum-up and then calculate vs. calculate and then sum-up (SSAS-MDX)

I have a cube in SSAS multidimensional mode.
I have created a calculating measure in visual studio called "Total Cost". The formula is:
[Measures].[Unit Cost]*[Measures].[Qty]
It is in the lowest level of granularity (i.e. - the transnational level information has these fields).
The formula works well, as long as I present the data in this same level of granularity (for example, when I create a pivot and the rows are transaction IDs - like the source file)
However, when I present it in an aggregate format (for example - by customer) - then instead of making the calculation and then sum it up, it sum up and then calculate.
Here is what I expected:
Expected results vs. What I get
My understanding, that this is regardless a (correct/incorrect) hierarchy structure. In other words, I expected this calculation to work even without defining any hierarchy between the transaction ID level and the customer level.
I'd appreciate your help!
In your SSAS project ->datasource view, you need to add a named calculation. This would be "[Unit Cost]*[Qty]". Now add this named calculation as a Measure in your Cube. This do the job. This problem was already addressed in the following link.
https://stackoverflow.com/questions/53554284/how-to-multiply-two-measures-prior-to-aggregation/53558733#53558733

How the aggregation and calculated members work as combined to produce output in SSAS Cube

I am creating a POC on the SSAS. Ultimate goal is to be able to perform any kind of the calculation either ad hoc calculation or pre calculated with good performance. Existing solutions is based on the SQL server but due to the performance issues with huge data facing issues.
I need some insight upon how the Cube works to give faster outputs. I have created date dimensions with hierarchy Year-> Semester-> Quarter -> Month -> Week -> Date. Several other dimensions are linked with the date dimension. My cube has almost 10 to 15 dimension which have several role playing dimensions.There are almost two to three dates in every fact table.
How the Cube aggregates the data based on the dimensions linked to the facts?
Does it internally creates all the combination of the dimension values and saves the fact aggregate data internally?
Here i have attached an MDX script which hase YTD,MTD,QTD Calculated Measures.[Measures].[Value] measure has to be added based on the function applied on the date dimension. Does SSAS internally sum up the [Measures].[Value] for various hierarchy of the date/Other dimension/s? What exactly SSAS does to provide the final value fast?
Our system has large number of the fields whose calculation depends on the value selected by the end user to the number has to be calculated at run time by aggregating some other measures. Does SSAS is fast to provide the Calcualted Member output by using the internally aggregated values generated during the cube processing?
With Member [Measures].[YTDValue] as ([Measures].[Value],
OpeningPeriod([Rundate].[Calendar].[Date],[Rundate].[Calendar].CurrentMember.Parent.Parent.Parent.Parent.Parent))
Member [Measures].[QTDValue]
as ([Measures].[Value],OpeningPeriod([Rundate].[Calendar].[Date],[Rundate].[Calendar].CurrentMember.Parent.Parent.Parent))
Member [Measures].[MTDValue]
as ([Measures].[Value],OpeningPeriod([Rundate].[Calendar].[Date],[Rundate].[Calendar].CurrentMember.Parent.Parent))
SELECT
{
[Measures].[YTDValue],
[Measures].[QTDValue],
[Measures].[MTDValue],
} on 0,
{
[Rundate].[Calendar].[Date].Members
} ON 1
FROM
(
select
{
[Rundate].[Calendar].[Date].&[2015-01-09T00:00:00]
} on 0
from [Cube_Sample]
)

SSAS Max calculation in cube

I have a dimension list of Product Codes and a measure called ACV in my cube. I need to be able to calculate the maximum ACV value for each product code.
I have got as far as the calculation below but that returns the sum of ACV for all products.
MAX([Products].[Product Code].[Product Code].Members, [Measures].[ACV])
I'd be grateful for input on how to resolve my problem.
Thanks!
If you want the maximum evaluated semiadditively by the grain of your model designed in the data source view, you should add a new measure (based on the same source field as the ACV measure) to your cube add set its AggregationFunction property to Max. More on aggregation functions in SSAS.

MDX Measure Filtering

I am building a Mondrian Cube that shows information for a large range of dates. One of the measures for this cube is an average of a percentage value. Because some of the items in the cube should not make up the final average, I need to know how to filter them out based off this measure and only for this calculated member.
Found the solution to this thanks to the group over at the Pentaho forum:
http://forums.pentaho.org/showthread.php?t=75742