dbTalk Databases Forums  

Re: XMLA and % symbol

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


Discuss Re: XMLA and % symbol in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: XMLA and % symbol - 09-13-2003 , 06:10 PM






"carloes" <carloes (AT) daisylabs (DOT) com> wrote

Quote:
Hi All.

I'm building a XMLA viewer that works inside Explorer.
I'd create a MDX, let me say this, as example:
----------------------------------MDX---------------------------
with
member [Product].[All Products].[Drink].[Percent of Alcoholic
Drinks] as '[Product].[All Products].[Drink].[Alcoholic
Beverages]/[Product].[All Products].[Drink]', format = '#.00%'
---------------
select
{ [Product].[All Products].[Drink].[Percent of Alcoholic Drinks] }
on columns,
order([Customers].[All Customers].[USA].[WA].Children,
[Product].[All Products].[Drink].[Percent of Alcoholic Drinks],BDESC )
on rows
from Sales
where ( [Measures].[Unit Sales] )
--------------------------------------------------------------------
This is a classic MDX that you could find in the standard
MDXSampleApplication.
Please focus on "format='#.00%"b
When i execute this MDX i receive the XMLA.
In particular below you can find an exemple of CellData tag


- <CellData
- <Cell CellOrdinal="0"
Value xsi:type="xsd:double">0.44047619047619</Value
FmtValue>,44</FmtValue
/Cell

How do i recognize that this number should be represented with percent
symbol?
This isn't really XMLA question, but more of MDX formatting question. You
have some non-standard locales along the way. The best solution, in my
opinion, would be to use different format_string, i.e.

with
member [Product].[All Products].[Drink].[Percent of Alcoholic
Drinks] as '[Product].[All Products].[Drink].[Alcoholic
Beverages]/[Product].[All Products].[Drink]', format = 'Percent'

Then you will get


- <CellData>
- <Cell CellOrdinal="0">
<Value xsi:type="xsd:double">0.44047619047619</Value>
<FmtValue>44.05%</FmtValue>
</Cell>

HTH,
Mosha

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #2  
Old   
carloes
 
Posts: n/a

Default Re: XMLA and % symbol - 09-17-2003 , 07:52 AM






Thx A lot!

Carloes at daisylabs dot 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.