dbTalk Databases Forums  

Problem with aggregate function

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


Discuss Problem with aggregate function in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bdomain@elv.enic.fr
 
Posts: n/a

Default Problem with aggregate function - 02-02-2006 , 05:37 AM






Hello,

I use aggregate function to calculate measures on period of time. For
example:

Income from 01/01/2006 to 01/15/2006 or income from 01/01/2005 to
12/31/2005

I'va got a time dimension with this hierarchy:
year - quarter - month - week - day

When i used the aggregate function (from 01/01/2006 to 12/31/2006):
AGGREGATE({[EVENEMENT].[Temps
Numérique].&[1].&[2006].&[1].&[1].&[1].&[1]:
[EVENEMENT].[Temps Numérique].&[1].&[2006].&[4].&[12].&[53].&[365]}

I've got my result but when i cross the years, I've null values. For
example from 01/01/2005 to 12/31/2006:

WITH MEMBER [EVENEMENT].[Temps Numérique].[Periode 1] as
(AGGREGATE({[EVENEMENT].[Temps Numérique].&[2005].&[1].&[1].&[1].&[1]:
[EVENEMENT].[Temps Numérique].&[2006].&[4].&[12].&[53].&[365]}))

Could you help me please?


Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: Problem with aggregate function - 02-03-2006 , 04:02 AM






One possible cause if this is if you have reversed the order of the
years (to make the most recent year sort to the top)

If you have done this 2006 actually sorts before 2005 so your date range
will not work correctly.

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1138880232.736381.110600 (AT) z14g2000cwz (DOT) googlegroups.com>,
bdomain (AT) elv (DOT) enic.fr says...
Quote:
Hello,

I use aggregate function to calculate measures on period of time. For
example:

Income from 01/01/2006 to 01/15/2006 or income from 01/01/2005 to
12/31/2005

I'va got a time dimension with this hierarchy:
year - quarter - month - week - day

When i used the aggregate function (from 01/01/2006 to 12/31/2006):
AGGREGATE({[EVENEMENT].[Temps
Numérique].&[1].&[2006].&[1].&[1].&[1].&[1]:
[EVENEMENT].[Temps Numérique].&[1].&[2006].&[4].&[12].&[53].&[365]}

I've got my result but when i cross the years, I've null values. For
example from 01/01/2005 to 12/31/2006:

WITH MEMBER [EVENEMENT].[Temps Numérique].[Periode 1] as
(AGGREGATE({[EVENEMENT].[Temps Numérique].&[2005].&[1].&[1].&[1].&[1]:
[EVENEMENT].[Temps Numérique].&[2006].&[4].&[12].&[53].&[365]}))

Could you help me please?



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.