Solved

avg mdx in sql 2012. Has it changed?

Posted on 2015-02-10
2
64 Views
Last Modified: 2016-02-18
Hi

I had the following calculation in SQL 2008R2 cubes:

(([Measures].[Activity Count],[Age].[Hierarchy Adult - Child Age].[All].[Age 0-18])/AVG(Descendants([Date From Source Data].[Fiscal YQM].currentmember,[Date From Source Data].[Fiscal YQM].[Fiscal Month Name]),[Measures].[0-18])) * 1000

It doesn't seem to be working in SQL 2012, and whether the AVG is the problem or not I dont know yet. Is anybody aware that the AVG mdx function has changed in any way? It is red squiggle underlined in the mdx editor in the SSAS design time interface in SQL Server data tools. This makes me think that there is something that has changed but there are a few other elements that I need to check too.

If anyone knows anything about this any info would be gratefully received.

Cheers

T
0
Comment
Question by:trawley
2 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
Comment Utility
AVG(mdx)

Comparing 2008R2
https://msdn.microsoft.com/en-us/library/ms146067(v=sql.105).aspx
The Avg function calculates the average of the nonempty values of cells in the specified set by first calculating the sum of values across cells in the specified set, and then dividing the calculated sum by the count of nonempty cells in the specified set.
to SQL 20012
https://msdn.microsoft.com/en-us/library/ms146067(v=sql.110).aspx
The Avg function calculates the average of the nonempty values of cells in the specified set by first calculating the sum of values across cells in the specified set, and then dividing the calculated sum by the count of nonempty cells in the specified set.

I cannot see any difference (that matter).

{edited}
0
 
LVL 3

Author Comment

by:trawley
Comment Utility
Yes the avg seems to get the squiggly red underline but it works just fine. Cheers T
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now