?
Solved

avg mdx in sql 2012. Has it changed?

Posted on 2015-02-10
2
Medium Priority
?
140 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 49

Accepted Solution

by:
PortletPaul earned 2000 total points
ID: 40602368
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
ID: 40641756
Yes the avg seems to get the squiggly red underline but it works just fine. Cheers T
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

770 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