Showing posts with label aggregation. Show all posts
Showing posts with label aggregation. Show all posts

Thursday, February 16, 2012

AverageOfChildren Aggregation function gives error.

Hi

This is a very peculiar problem, and I did not find any entry on the net regarding this.

Background: I have written .Net 2.0 programs that use AMO and create the complete gamut of SSAS 2005 objects at one go. They create Dimensions, Cubes, MeasureGroups, Measures, Partitions....etc. This is working and after processin the objects, they are browsable also.

Now the problem is: When i create a measure, I am not specifying any AggregationFunction (Not even 'None'), but the default aggregation 'SUM' is added automatically.

question 1: Why is this? How to avoid this?

Since I dont want the 'SUM' aggregation for some of the measures, I open BI studio and change one of the measure's aggregation function to 'AverageOfChildren', I get an error as soon as i do this. The measure is now underlined with the curly red (indicating an error). The error msg displayed is: Cube xyz cannot be saved because:

Cube 'xyz' > Measure Group 'abc' > Measure 'def' : Aggregate function AverageOfChildren is not allowed in Standard server edition.

question 2: What is this? Why is this? how to go about further from this?

Is this really because we use the standard server edition? (I dont know which edition we use)

Thanks and Regards

Vijay R

Yes, some functionality is only available in the Enterprise SKU. The BI Studio environment uses a property to allow you to develop targeting a particular SKU (which will change the client-side validation -- the red squigglies). This allows for a visual way to design an Analysis Services database that limits its features to the standard SKU. When the project is deployed, validation is done again by the server.

In general, semi-additive measures are only available in enterprise edition (like AverageOfChildren, LastNonEmpty, FirstNonEmpty and None).

Hope that helps.

Monday, February 13, 2012

Average aggregation

Hi! experts!

I just want to use the average in our measure group.

Unfortunately, there wasn't average aggreation, except averageOfChildren.

How can I implement the average aggreation?

thanks in advance.

Hi from Brazil,

"averageOfChildren" is same "Average" agregation function.

Note: It run just over SQL Server Enterprise or developer version. Not over Standard Version

Regards!

|||

AverageOfChildren will only average over the time dimension - so a typical approach to average over fact rows is:

Create a measure with "sum" aggregation on the fact table field to be averaged

Create a measure with "count" aggregation and row binding (created by default for a new measure group)

Create a calculated measure like: "average" = "sum" / "count"

Avareges for period

Hi,

I am trying to get average for sales for last 30 days.

Aggregation function for [Measures].[Avg Sales] is AverageOfChildren

Next code returns correct result

SELECT { [Measures].[Avg Sales] } ON columns

FROM [Sales]

where ([Dim Date].[Year - Day].[Day].&[2/14/2007]&[2]:[Dim Date].[Year - Day].[Day].&[3/15/2007]&[3])

But this query is not flexible. Should be selected day and returned value for 30 days back.

For example, I am trying to use next code

select

([Dim Date].[Year - Day].[Day].CurrentMember.lead(29) : [Dim Date].[Year - Day].[Day].CurrentMember

, [Measures].[Avg Sales]) // average for 30 days back

ON columns

FROM [SAles]

where ([Dim Date].[Year - Day].[Day].&[3/15/2007]&[3])

But recieved error "The Tuple function expects a tuple expression for the argument. A tuple set expression was used."

What the query should be to resolve this problem?

Thanks for help.

Try creating a query calculated measure for this,like:

With

Member [Measures].[Trailing30Sales] as

Aggregate({[Dim Date].[Year - Day].Lag(29) : [Dim Date].[Year - Day].CurrentMember},

[Measures].[Avg Sales])

select

{[Measures].[Trailing30Sales]} // average for 30 days back

ON columns

FROM [Sales]

where ([Dim Date].[Year - Day].[Day].&[3/15/2007]&[3])

|||

Thank you, very much!

It is very simple