Solved

avg mdx in sql 2012. Has it changed?

Posted on 2015-02-10
2
73 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
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

864 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

23 Experts available now in Live!

Get 1:1 Help Now