dbTalk Databases Forums  

Special Cube Dimension - Average instead of sum

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Special Cube Dimension - Average instead of sum in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lvpaul@gmx.net
 
Posts: n/a

Default Special Cube Dimension - Average instead of sum - 02-08-2006 , 04:48 AM






Hello !

I have a special olap cube based on a table.

Each day I add the current date and the sum of the open orders into the
table.

date sum_openorders
01.01.2006 500 000
02.01.2006 600 000
03.01.2006 600.000
04.01.2006 300.000 ...

The target is to show the development of the open orders.

On the column date I have created a dimension "devdate" with levels
"year" "month" and "day".

My problem is, that the Result of the month- and year-level are wrong.
As level-result I need the average of the openorders, not the sum.
(In the example 500.000 instead of 2.000.000)

Can I set this in the Analysis-Manager ?

Thanks
aaapaul


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Special Cube Dimension - Average instead of sum - 02-08-2006 , 11:36 PM






http://groups.google.com/group/micro...olap/msg/2eee9
be79b77096f
Quote:
Newsgroups: microsoft.public.sqlserver.olap
From: Deepak Puri
Date: Sat, 19 Nov 2005 22:42:35 -0800
Subject: Re: Slow Calculations

It may be possible (depending on what the fact table looks like) to
compute [Measures].[Avg Points] as a 'Sum' measure divided by a 'Count'
measure. This would avoid computing averages 'on-the-fly', and the
overall versus individual averages can then be compared by navigating
the appropriate dimension hierarchy, like [Team].

http://groups.google.com/group/micro...olap/msg/6e9d7
3404113dfa0

Newsgroups: microsoft.public.sqlserver.olap
From: "Sean Boon [MS]"
Date: Mon, 14 Jul 2003 10:55:54 -0700
Subject: Re: avg

If you want to create an average, what you need to do is create one
measure
called SUM, and another measure based on COUNT and then create a
calculated
member called AVG which would just be SUM/COUNT. I believe there are
examples of this in the Foodmart 2000 cubes.

Sean

--
Sean Boon
SQL Server BI Product Unit
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
lvpaul@gmx.net
 
Posts: n/a

Default Re: Special Cube Dimension - Average instead of sum - 02-14-2006 , 04:01 AM



Thanks Sean !

Can anybody help me to create the expression (calculated member):
My dimenstion xdate:
level year
level month
level day

I want to have the sum/amount of the days in an expression:

I tried
"count(descendants([xdate].currentmember.children))"
but the problem is that this expression counts the interim results too.

Can you correct it ?

Thanks.
Paul


Reply With Quote
  #4  
Old   
lvpaul@gmx.net
 
Posts: n/a

Default Re: Special Cube Dimension - Average instead of sum - 02-14-2006 , 04:21 AM



Eureka !

count(descendants([Heute].currentmember,[Heute].[Tag]))

Thanks
Paul !

Next question comes certainly.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.