dbTalk Databases Forums  

Dynamic formatting in MDX?

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


Discuss Dynamic formatting in MDX? in the microsoft.public.sqlserver.olap forum.



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

Default Dynamic formatting in MDX? - 10-13-2004 , 03:51 AM






Hello

I've a problem with formatting. A measure I have can contain both an amount
and a percentage and I'd like to format it as a percentage if the value is
below 1. Can this be done at all??

Thank you

Tore



Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: Dynamic formatting in MDX? - 10-15-2004 , 05:25 AM






There's no *nice* way of doing it, but the following query demonstrates how
calculated measures can inherit the formats of other calculated measures,
which might help you do what you want:

WITH
MEMBER MEASURES.PERCENTFORMAT AS 'MEASURES.[UNIT SALES]',
FORMAT_STRING='PERCENT'
MEMBER MEASURES.OTHERFORMAT AS 'MEASURES.[UNIT SALES]', FORMAT_STRING='#,#.00'
MEMBER MEASURES.VARIABLEFORMAT AS 'IIF([Gender].CURRENTMEMBER IS
[Gender].[All Gender].[F], MEASURES.PERCENTFORMAT, MEASURES.OTHERFORMAT)'
SELECT {MEASURES.PERCENTFORMAT, MEASURES.OTHERFORMAT,
MEASURES.VARIABLEFORMAT} ON 0,
[Gender].[Gender].MEMBERS ON 1
FROM SALES

HTH,

Chris


"Tore Johnsen" wrote:

Quote:
Hello

I've a problem with formatting. A measure I have can contain both an amount
and a percentage and I'd like to format it as a percentage if the value is
below 1. Can this be done at all??

Thank you

Tore




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.