dbTalk Databases Forums  

MDX Syntax problem

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


Discuss MDX Syntax problem in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gunnar Karlsson
 
Posts: n/a

Default MDX Syntax problem - 04-11-2005 , 04:08 AM






I have a very simple cube consisting of two dimensions and one measure.
The first dimensions is an ordinary Time-dimension (Year, Month,
Quarter, Day) and the second Flow_type, is a flat dimension with just
three members, 1=
Opening Balance, 2 = In, 3 = Out.

In the Calculated Members Builder I have created a Calculated Measure
with the following syntax :

Iif([Flow_Type] = 0, [Measures].[Quantity], Null)

I don’t get any syntax error when I click the Check-button, but
something is wrong because the Calculated Measure just returns “Err”.
What’s wrong?



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

Reply With Quote
  #2  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: MDX Syntax problem - 04-11-2005 , 12:50 PM






It's because of "[Flow_Type] = 0".

Here, [Flow_Type] means ([Flow_Type].CurrentMember, Measures.CurrentMember),
and Measures.CurrentMember means the Calculated Measure itself, which
results in infinite recursive call.

What do you want to mean by "[Flow_Type] = 0" exactly?

Ohjoo Kwon


"Gunnar Karlsson" <gunnar.karlsson (AT) intellibis (DOT) se> wrote

Quote:
I have a very simple cube consisting of two dimensions and one measure.
The first dimensions is an ordinary Time-dimension (Year, Month,
Quarter, Day) and the second Flow_type, is a flat dimension with just
three members, 1=
Opening Balance, 2 = In, 3 = Out.

In the Calculated Members Builder I have created a Calculated Measure
with the following syntax :

Iif([Flow_Type] = 0, [Measures].[Quantity], Null)

I don't get any syntax error when I click the Check-button, but
something is wrong because the Calculated Measure just returns "Err".
What's wrong?



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



Reply With Quote
  #3  
Old   
GunnarKarlsson
 
Posts: n/a

Default Re: MDX Syntax problem - 04-12-2005 , 02:37 AM



Flow_Type is a dimension with three types of members, so what I mean by
[Flow_Type] = 0 is that this calculated measure should only be given a value
if the dimension member is of type = 0.

"Ohjoo Kwon" wrote:

Quote:
It's because of "[Flow_Type] = 0".

Here, [Flow_Type] means ([Flow_Type].CurrentMember, Measures.CurrentMember),
and Measures.CurrentMember means the Calculated Measure itself, which
results in infinite recursive call.

What do you want to mean by "[Flow_Type] = 0" exactly?

Ohjoo Kwon


"Gunnar Karlsson" <gunnar.karlsson (AT) intellibis (DOT) se> wrote in message
news:%23$ZVs2mPFHA.576 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have a very simple cube consisting of two dimensions and one measure.
The first dimensions is an ordinary Time-dimension (Year, Month,
Quarter, Day) and the second Flow_type, is a flat dimension with just
three members, 1=
Opening Balance, 2 = In, 3 = Out.

In the Calculated Members Builder I have created a Calculated Measure
with the following syntax :

Iif([Flow_Type] = 0, [Measures].[Quantity], Null)

I don't get any syntax error when I click the Check-button, but
something is wrong because the Calculated Measure just returns "Err".
What's wrong?



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




Reply With Quote
  #4  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: MDX Syntax problem - 04-12-2005 , 05:26 AM



If I understand what you said rightly, you want this kind of expression?

IIF([Flow_Type].CurrentMember IS [Flow_Type].[0], [Measures].[Quantity],
Null)

Ohjoo

"GunnarKarlsson" <GunnarKarlsson (AT) discussions (DOT) microsoft.com> wrote

Quote:
Flow_Type is a dimension with three types of members, so what I mean by
[Flow_Type] = 0 is that this calculated measure should only be given a
value
if the dimension member is of type = 0.

"Ohjoo Kwon" wrote:

It's because of "[Flow_Type] = 0".

Here, [Flow_Type] means ([Flow_Type].CurrentMember,
Measures.CurrentMember),
and Measures.CurrentMember means the Calculated Measure itself, which
results in infinite recursive call.

What do you want to mean by "[Flow_Type] = 0" exactly?

Ohjoo Kwon


"Gunnar Karlsson" <gunnar.karlsson (AT) intellibis (DOT) se> wrote in message
news:%23$ZVs2mPFHA.576 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
I have a very simple cube consisting of two dimensions and one
measure.
The first dimensions is an ordinary Time-dimension (Year, Month,
Quarter, Day) and the second Flow_type, is a flat dimension with just
three members, 1=
Opening Balance, 2 = In, 3 = Out.

In the Calculated Members Builder I have created a Calculated Measure
with the following syntax :

Iif([Flow_Type] = 0, [Measures].[Quantity], Null)

I don't get any syntax error when I click the Check-button, but
something is wrong because the Calculated Measure just returns "Err".
What's wrong?



*** 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.