SSAS Time state rollup - ssas

I have the following situation (in SSAS):
http://i.imgur.com/D1xrYrv.jpg
Cube with two dimensions (Time / Alpha) and one measure (X)
Columns A - G is the result of the cube, with column G as the total sum.
How to get the average (like column H) instead of sum in SSAS?
It's called "Time state rollup" in Cognos, but how to get this in Microsoft?

I would try the Measure Aggregation Function: AverageOfChildren.

Related

Webi SAP BO Sum in block depending on two dimensions

I am trying to sum every line in a table summarizing it by two fields in webi.
I have a table with the following columns:
Risk, Year, AssessedBy, Weight, Value.
I have filtered the table by Year = 2018 and Risk = "01". Thus, I only have the info for that year and that risk.
Each person assessing has a different weight in the final valuation by risk and year. What I have done is divide the assessing person's weight by the total sum of every Weight in the table [ sum(weight) in block ].
The problem is that when I delete the filter, the in block clause makes that the total sum of the weights changes to the total sum of the weights for every year in the table.
I would need something to calculate the total sum for each year and risk.
Just solved it! Just see Sumal Kunir answer: http://www.forumtopics.com/busobj/viewtopic.php?p=971131
=sum([Var_a] for each(Dimension;dimension)) In (Demension)
where var_a is the measure, foreach defines a background to base in and in defines the level at which you want to aggregate.

SSAS - YTD SUM with other dimension

I would like to have a calculated measure (rolling_sum) that sums up all the values up to a selected month in the year and I would like to be able to query this measure without the date dimension.
So, I have the following calculated member:
SUM(YTD(),[Measures].[Value])
Querying this measure works fine when the query includes the date dimension, however I would like to be able to query this measure by other dimensions without the date dimension.
Would this be possible?

Create MDX to Divide two measures for each month and then sum the all of the months

I have a multidimensional cube that needs a custom measure that I'm not sure how to build.
That data looks like this:
MemberID-----Date-------EventType
1--------------1/1/2016-------1
2--------------1/1/2016-------2
3--------------2/1/2016-------1
2--------------2/1/2016-------2
4--------------2/1/2016-------2
There is a count measure in the cube, but others can be added if needed. I need to create a measure that will use whatever filters the user applies and then count the EventType (1 and 2 only) by month, divide the resulting counts for EventType 1 into the count for EventType 2 (for each month individually), and finally sum the monthly results. For example 1/1/2016 would be 1/1=1 (count of EventType 1 and count of EventType 2) and 2/1/2016 would be 1/2=0.5 so the resulting measure value for the two months would be 1+0.5=1.5. Any help is greatly appreciated.
Let's assume you have a Date dimension with an attribute called Month. And let's assume you have an EventType dimension. And let's assume you have a count measure in your measure group called Cnt. Here's what else you need to do.
First, go to the DSV and add a new calculated column to the fact table which is called NullInt and is the following expression:
cast(null as int)
Then create a new Sum measure in your measure group off that column and call the measure My Rollup. Under the Source property, change NullHandling to Preserve so that it will start off null.
To explain why we're doing this, a scoped assignment to a physical measure will aggregate up. (If you assign a value to a physical measure at the grain of each month, then it will rollup to the grand total.) But a scoped assignment to a calculated measure doesn't roll up.
Then in your MDX script add the following calculations:
scope([Date].[Month].[Month].Members); //calculate at the month level then rollup
[Measures].[My Rollup] = DIVIDE(
([Event Type].[Event Type].&[1],[Measures].[Cnt]),
([Event Type].[Event Type].&[2],[Measures].[Cnt])
);
end scope;
Note that your version of SSAS probably has the DIVIDE function if it's AS2012 with the latest service pack or newer. But if it doesn't, you can always do division the old fashioned way as IIF(denom=0,null,num/denom).

Avg Over time in Cube

In fact table, I have column named BusinessDays.
In Cube structure , I choose "Avg over time (Business Days) "in usage when I create new measure named Measure A
I also have time dimension in cube.
In Calculations, I created measure B : Avg = SUM (Business Days)/Count (Business Days).
When I write the following MDX
Using Measure A
select A on 0,
[date].[Year].[2015] on 1
From Cube
Using Measure B
select A on 0,
[date].[Year].[2015] on 1
From Cube
But results are different from each other, Supposedly, results should be same.
Actually , Measure B is correct.
Any Idea ?

SSAS custom total for rates (weighting average)

I need to change the total of an interest rate column. I mean, the total in the rate column is summarizing and I need the weighting average instead of the total. for example:
amount..........rate
450000..........8.75
390000..........8
15000...........2
855000(total)...8.29 (weighting average)
I'm trying to do it in the CALCULATIONS tab of the SSAS, but I cannot identify the total level for each group.
Please some ideas, point me to the right direction...
Thanks
JA
I would add a calculation to your source SQL views or DSV to calculate e.g. rate weight = rate * amount. I would then add that as a normal measure, Sum aggregation, hidden once you have finished testing.
Then the SSAS calculation becomes: rate weight / amount (wrapped in the typical Iif function to avoid dividing by zero).
At the leaf levels this returns weight. At any summary level it will return weighted average.