dbTalk Databases Forums  

mdx 2000

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


Discuss mdx 2000 in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
michael v
 
Posts: n/a

Default mdx 2000 - 06-22-2006 , 05:20 PM






any idea why this gives an error

sum({[Tid].[Dag].&[1/01/1998]:[Tid].currentmember},[Measures].[Beløbx])






Reply With Quote
  #2  
Old   
michael v
 
Posts: n/a

Default Re: mdx 2000 - 06-22-2006 , 05:27 PM






it accepts the syntax but gives error when displyaing result

"michael v" <test (AT) test (DOT) com> wrote

Quote:
any idea why this gives an error

sum({[Tid].[Dag].&[1/01/1998]:[Tid].currentmember},[Measures].[Beløbx])








Reply With Quote
  #3  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: mdx 2000 - 06-22-2006 , 08:27 PM



Hi Michael,

Are you trying to sum up the (I don't have the same character set) Belobx
measure from 1/1/98 to whatever date the user selects? You're defining a
range inclusive from 1/1/98 to the current member of the date dimension, but
the way you have it specified, the two are potentially on different levels.

I don't know what the results will be in the first place, but try changing
the 2nd member of the range clause to
[Tid].[Dag].CurrentMember to get them on the same level.


"michael v" <test (AT) test (DOT) com> wrote

Quote:
it accepts the syntax but gives error when displyaing result

"michael v" <test (AT) test (DOT) com> wrote in message
news:u5prdoklGHA.3304 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
any idea why this gives an error

sum({[Tid].[Dag].&[1/01/1998]:[Tid].currentmember},[Measures].[Beløbx])










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

Default Re: mdx 2000 - 06-22-2006 , 08:46 PM



Could be because [Tid].currentmember is not at the same level of [Tid]
as [Tid].[Dag].&[1/01/1998]. For example, this Foodmart query returns
errors at the year and quarter level:

Quote:
With Member [Measures].[SalesRange] as
'Sum([Time].[1997].[Q1].[1]:[Time].CurrentMember,
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales
Quote:

But it works fine if YTD() is used instead of range:

Quote:
With Member [Measures].[SalesRange] as
'Sum(YTD([Time].CurrentMember),
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #5  
Old   
michael v
 
Posts: n/a

Default Re: mdx 2000 - 06-23-2006 , 02:38 AM



tx both

yes i i'm trying to sum up to the date chosen by user bot from a specifc
start date.

Didnt' get how to adjust the code - can see that they not on the same level
but not how to solve it.

"Tim Dot NoSpam" <Tim (AT) MindYourSpammy (DOT) spam> wrote

Quote:
Hi Michael,

Are you trying to sum up the (I don't have the same character set) Belobx
measure from 1/1/98 to whatever date the user selects? You're defining a
range inclusive from 1/1/98 to the current member of the date dimension,
but
the way you have it specified, the two are potentially on different
levels.

I don't know what the results will be in the first place, but try changing
the 2nd member of the range clause to
[Tid].[Dag].CurrentMember to get them on the same level.


"michael v" <test (AT) test (DOT) com> wrote in message
news:%235uRBsklGHA.2136 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
it accepts the syntax but gives error when displyaing result

"michael v" <test (AT) test (DOT) com> wrote in message
news:u5prdoklGHA.3304 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
any idea why this gives an error

sum({[Tid].[Dag].&[1/01/1998]:[Tid].currentmember},[Measures].[Beløbx])












Reply With Quote
  #6  
Old   
michael v
 
Posts: n/a

Default Re: mdx 2000 - 06-23-2006 , 02:39 AM



tx deepak

but this is only a ytd - example ?

i need to sum across years...

"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Could be because [Tid].currentmember is not at the same level of [Tid]
as [Tid].[Dag].&[1/01/1998]. For example, this Foodmart query returns
errors at the year and quarter level:


With Member [Measures].[SalesRange] as
'Sum([Time].[1997].[Q1].[1]:[Time].CurrentMember,
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



But it works fine if YTD() is used instead of range:


With Member [Measures].[SalesRange] as
'Sum(YTD([Time].CurrentMember),
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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



Reply With Quote
  #7  
Old   
michael v
 
Posts: n/a

Default Re: mdx 2000 - 06-23-2006 , 05:00 AM



atually think i got it solved like this

sum([Tid].[År].&[1/01/1998]:ancestor(parallelperiod([År],1,[tid].currentmemb
er),[År]),[Measures].[Beløbx])+sum(ytd(),[measures].[beløbx])
and the sentence doenst look to bad - no IIF's...


"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Could be because [Tid].currentmember is not at the same level of [Tid]
as [Tid].[Dag].&[1/01/1998]. For example, this Foodmart query returns
errors at the year and quarter level:


With Member [Measures].[SalesRange] as
'Sum([Time].[1997].[Q1].[1]:[Time].CurrentMember,
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



But it works fine if YTD() is used instead of range:


With Member [Measures].[SalesRange] as
'Sum(YTD([Time].CurrentMember),
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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



Reply With Quote
  #8  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: mdx 2000 - 06-23-2006 , 06:38 AM



Yes, but that "o" has that funny line through it. <g>

Goede Morgen!

"michael v" <test (AT) test (DOT) com> wrote

Quote:
atually think i got it solved like this

sum([Tid].[År].&[1/01/1998]:ancestor(parallelperiod([År],1,[tid].currentmemb
er),[År]),[Measures].[Beløbx])+sum(ytd(),[measures].[beløbx])
and the sentence doenst look to bad - no IIF's...


"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote in message
news:eumfPbmlGHA.5044 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
Could be because [Tid].currentmember is not at the same level of [Tid]
as [Tid].[Dag].&[1/01/1998]. For example, this Foodmart query returns
errors at the year and quarter level:


With Member [Measures].[SalesRange] as
'Sum([Time].[1997].[Q1].[1]:[Time].CurrentMember,
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



But it works fine if YTD() is used instead of range:


With Member [Measures].[SalesRange] as
'Sum(YTD([Time].CurrentMember),
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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





Reply With Quote
  #9  
Old   
michael v
 
Posts: n/a

Default Re: mdx 2000 - 06-23-2006 , 02:38 PM



He he

"Tim Dot NoSpam" <Tim (AT) MindYourSpammy (DOT) spam> wrote

Quote:
Yes, but that "o" has that funny line through it. <g

Goede Morgen!

"michael v" <test (AT) test (DOT) com> wrote in message
news:eQ3uJvqlGHA.5036 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
atually think i got it solved like this


sum([Tid].[År].&[1/01/1998]:ancestor(parallelperiod([År],1,[tid].currentmemb
er),[År]),[Measures].[Beløbx])+sum(ytd(),[measures].[beløbx])
and the sentence doenst look to bad - no IIF's...


"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote in message
news:eumfPbmlGHA.5044 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
Could be because [Tid].currentmember is not at the same level of [Tid]
as [Tid].[Dag].&[1/01/1998]. For example, this Foodmart query returns
errors at the year and quarter level:


With Member [Measures].[SalesRange] as
'Sum([Time].[1997].[Q1].[1]:[Time].CurrentMember,
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



But it works fine if YTD() is used instead of range:


With Member [Measures].[SalesRange] as
'Sum(YTD([Time].CurrentMember),
[Measures].[Unit Sales])'
select {[Measures].[Unit Sales],
[Measures].[SalesRange]} on 0,
Descendants([Time].[1997]) on 1
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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







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.