![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have Calculated member in which the expression is : WITH MEMBER [Measures].[Test] AS SUM(<SET1>,[Measures].[Total Hours] / [Measures].[Available Hours]) SELECT [MEasures].[Test] on 0 FROM [<cube>] WHERE (<member expression1>, <member expression2>) When I execute this expression in the SQL Management Studio I get the result as "-1.#IND". However, when I use only one measure in the SUM() (w/o the division) it returns to me the correct SUM() for the measure. I have checked out the underlying facts and they do not have any negative values. Thanks in advance for your help. -- Thank you, Ashok G |
#3
| |||
| |||
|
|
you have a divide by 0 error. Try something like: SUM(<SET1>, iif( [Measures].[Total Hours] = 0 or [Measures].[Available Hours], 0, [Measures].[Total Hours] / [Measures].[Available Hours]) ) or with member measures.s1 as SUM(<SET1>,[Measures].[Total Hours]) , member measures.s2 as SUM(<SET1>,[Measures].[Total Hours]) , MEMBER [Measures].[Test] AS iif(measures.s1 =0 or measures.s2=0, 0 , measures.s1 / measures.s2) "Ashok G" <ashokg (AT) discussions (DOT) microsoft.com> wrote in message news:69632678-96B4-4EB5-B766-4B63A5E12B8F (AT) microsoft (DOT) com... I have Calculated member in which the expression is : WITH MEMBER [Measures].[Test] AS SUM(<SET1>,[Measures].[Total Hours] / [Measures].[Available Hours]) SELECT [MEasures].[Test] on 0 FROM [<cube>] WHERE (<member expression1>, <member expression2>) When I execute this expression in the SQL Management Studio I get the result as "-1.#IND". However, when I use only one measure in the SUM() (w/o the division) it returns to me the correct SUM() for the measure. I have checked out the underlying facts and they do not have any negative values. Thanks in advance for your help. -- Thank you, Ashok G |
![]() |
| Thread Tools | |
| Display Modes | |
| |