dbTalk Databases Forums  

MDX Expression - Empty Cells

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


Discuss MDX Expression - Empty Cells in the microsoft.public.sqlserver.olap forum.



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

Default MDX Expression - Empty Cells - 06-22-2005 , 08:34 AM






Hi,

I am just trting to display 0.00 for all the empty cells in an calculated
member (MDX Expression) and i used the following syntax.

format(IIF([Measures].[Units Sold]<> 0,
[Measures].[Selling Price]/[Measures].[Units Sold],0),
"##.00;(##.00);#.00;#.00")

It always displays "0" not "0.00". Please let me know what is wrong in the
MDX Expression.

Thanks,

Sam.


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

Default Re: MDX Expression - Empty Cells - 06-22-2005 , 05:46 PM






Here's a sample query for Foodmart:

Quote:
With Member [Measures].[Format0] as
'IIF([Measures].[Unit Sales]<> 0,
[Measures].[Unit Sales],0)',
FORMAT_STRING = '##.00;(##.00);0.00;#.00'
Select {[Measures].[Unit Sales],
[Measures].[Format0]} on columns,
[Time].[Month].Members on rows
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: MDX Expression - Empty Cells - 06-23-2005 , 07:26 AM



Hi Deepak,

Thanks for your reply. But i want do this as part of the calculated member
with in the Analysis Manager.

I used the same format string in my calculated member and it does not work.
But your's works. The problem is i cannot use the the with clause in the
calculated member with in the Anlaysis Manager.

Please help. This is the last thing in my model.

MINE:
-------
format(IIF([Measures].[Units Sold]<> 0,
[Measures].[Selling Price]/[Measures].[Units Sold],0),
"##.00;(##.00);0.00;#.00")

YOURS:
---------

With Member [Measures].[Format0] as
'IIF([Measures].[Unit Sales]<> 0,
[Measures].[Unit Sales],0)',
FORMAT_STRING = '##.00;(##.00);0.00;#.00'

Select {[Measures].[Unit Sales],
[Measures].[Format0]} on columns,
[Time].[Month].Members on rows
from Sales




"Deepak Puri" wrote:

Quote:
Here's a sample query for Foodmart:


With Member [Measures].[Format0] as
'IIF([Measures].[Unit Sales]<> 0,
[Measures].[Unit Sales],0)',
FORMAT_STRING = '##.00;(##.00);0.00;#.00'
Select {[Measures].[Unit Sales],
[Measures].[Format0]} on columns,
[Time].[Month].Members on rows
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: MDX Expression - Empty Cells - 06-23-2005 , 01:07 PM



As you can see, my sample uses the "Format String" cell property of the
Calculated Member, whereas you used the VBA Format() function instead.
In Analysis Manager, under the "Advanced" tab of Calculated Member
Properties, you can set the "Format String" accordingly.


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