dbTalk Databases Forums  

Formatting MDX % Problem I looked everywhere about could not find any solution

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


Discuss Formatting MDX % Problem I looked everywhere about could not find any solution in the microsoft.public.sqlserver.olap forum.



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

Default Formatting MDX % Problem I looked everywhere about could not find any solution - 12-28-2006 , 05:03 PM






Below is my Calculated members:

iif(Measures.currentmember is [Measures].[Rx Base] OR
Measures.currentmember is [Measures].[Photo Base] OR
Measures.currentmember is [Measures].[Total Triple Base] OR
Measures.currentmember is [Measures].[Wait Time Base],
SUM([Time].[Year].[2005].Children,
Round(Measures.CurrentMember)),Avg([Time].[Year].[2005].Children,
Round(Measures.CurrentMember*100,0)))

I have "Solve Order" of 10.

For AVG the value for the cell is "85.4" but I wanted it to be "85.4%"
But for SUM it should be just the normal. So If I change the
"Format_String" then it change my SUM value too.


Any help will be really appreciate!!!
Sam


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

Default Re: Formatting MDX % Problem I looked everywhere about could not find any solution - 01-01-2007 , 08:04 AM






Next if-format works in AS 2005, but I do not test it in AS 2000.

Format_String=IIF(..., '#,#', '#,#.0 "%"')

Ohjoo

"Sam" <msam77 (AT) gmail (DOT) com> wrote

Quote:
Below is my Calculated members:

iif(Measures.currentmember is [Measures].[Rx Base] OR
Measures.currentmember is [Measures].[Photo Base] OR
Measures.currentmember is [Measures].[Total Triple Base] OR
Measures.currentmember is [Measures].[Wait Time Base],
SUM([Time].[Year].[2005].Children,
Round(Measures.CurrentMember)),Avg([Time].[Year].[2005].Children,
Round(Measures.CurrentMember*100,0)))

I have "Solve Order" of 10.

For AVG the value for the cell is "85.4" but I wanted it to be "85.4%"
But for SUM it should be just the normal. So If I change the
"Format_String" then it change my SUM value too.


Any help will be really appreciate!!!
Sam




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

Default Re: Formatting MDX % Problem I looked everywhere about could not find any solution - 01-04-2007 , 05:41 PM



Thanks But it does not work in AS 2000.

Do you have any another ideas?

Sameer


Ohjoo Kwon wrote:
Quote:
Next if-format works in AS 2005, but I do not test it in AS 2000.

Format_String=IIF(..., '#,#', '#,#.0 "%"')

Ohjoo

"Sam" <msam77 (AT) gmail (DOT) com> wrote in message
news:1167347019.088797.265000 (AT) 73g2000cwn (DOT) googlegroups.com...
Below is my Calculated members:

iif(Measures.currentmember is [Measures].[Rx Base] OR
Measures.currentmember is [Measures].[Photo Base] OR
Measures.currentmember is [Measures].[Total Triple Base] OR
Measures.currentmember is [Measures].[Wait Time Base],
SUM([Time].[Year].[2005].Children,
Round(Measures.CurrentMember)),Avg([Time].[Year].[2005].Children,
Round(Measures.CurrentMember*100,0)))

I have "Solve Order" of 10.

For AVG the value for the cell is "85.4" but I wanted it to be "85.4%"
But for SUM it should be just the normal. So If I change the
"Format_String" then it change my SUM value too.


Any help will be really appreciate!!!
Sam



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

Default Re: Formatting MDX % Problem I looked everywhere about could not find any solution - 01-04-2007 , 06:38 PM



With AS 2000 Enterpise Edition, you can use Calculated Cells to apply
different format for a measure, as i n this Foodmart example:

Quote:
With Cell Calculation [FormatAvg]
for '({[Measures].[Sales Average]})'
as 'CalculationPassValue([Measures].CurrentMember, -1, RELATIVE)',
FORMAT_STRING = '#.0"%"'
Cell Calculation [FormatSum]
for '({[Measures].[Unit Sales]})'
as 'CalculationPassValue([Measures].CurrentMember, -1, RELATIVE)',
FORMAT_STRING = '#,#'
select {[Measures].[Unit Sales], [Measures].[Sales Average]} on 0,
Non Empty [Product].[Product Category].Members on 1
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: Formatting MDX % Problem I looked everywhere about could not find any solution - 01-04-2007 , 06:40 PM



It looks like that there is no direct way with one single calculated member
in AS2000.

I tested two cases below and they work well with Foodmart 2000.

Case1: Using Calculated Members
with
member measures.a as '[Unit Sales]',format_string='#,##0%'
member measures.b as '[Unit Sales]',format_string='##0'
member measures.c as 'iif([Unit Sales] > 7000, a, b)'
select
{a, b, c, [Measures].[Unit Sales]} on columns,
order(except([Promotion Media].[Media Type].members,{[Promotion
Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rows
from Sales

Case2: Using Calculated Cells
with
cell calculation [Unit Sales<7000] FOR '({[Unit Sales]})' AS
'CalculationPassValue([Unit Sales],-1,Relative)',
CONDITION='CalculationPassValue([Unit Sales],-1,Relative)<7000',
FORMAT_STRING='#,##0"%"'
cell calculation [Unit Sales>=7000] FOR '({[Unit Sales]})' AS
'CalculationPassValue([Unit Sales],-1,Relative)',
CONDITION='CalculationPassValue([Unit Sales],-1,Relative)>=7000',
FORMAT_STRING='Currency'
select
{[Measures].[Unit Sales]} on columns,
order(except([Promotion Media].[Media Type].members,{[Promotion
Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rows
from Sales

Ohjoo



"Sam" <msam77 (AT) gmail (DOT) com> wrote

Quote:
Thanks But it does not work in AS 2000.

Do you have any another ideas?

Sameer


Ohjoo Kwon wrote:
Next if-format works in AS 2005, but I do not test it in AS 2000.

Format_String=IIF(..., '#,#', '#,#.0 "%"')

Ohjoo

"Sam" <msam77 (AT) gmail (DOT) com> wrote in message
news:1167347019.088797.265000 (AT) 73g2000cwn (DOT) googlegroups.com...
Below is my Calculated members:

iif(Measures.currentmember is [Measures].[Rx Base] OR
Measures.currentmember is [Measures].[Photo Base] OR
Measures.currentmember is [Measures].[Total Triple Base] OR
Measures.currentmember is [Measures].[Wait Time Base],
SUM([Time].[Year].[2005].Children,
Round(Measures.CurrentMember)),Avg([Time].[Year].[2005].Children,
Round(Measures.CurrentMember*100,0)))

I have "Solve Order" of 10.

For AVG the value for the cell is "85.4" but I wanted it to be "85.4%"
But for SUM it should be just the normal. So If I change the
"Format_String" then it change my SUM value too.


Any help will be really appreciate!!!
Sam





Reply With Quote
  #6  
Old   
Sam
 
Posts: n/a

Default Re: Formatting MDX % Problem I looked everywhere about could not find any solution - 01-05-2007 , 05:56 PM



Thanks Ohjoo and Deepak.

I am planning to go with Case 1. Good logic.

Thanks
Sameer

Ohjoo Kwon wrote:
Quote:
It looks like that there is no direct way with one single calculated member
in AS2000.

I tested two cases below and they work well with Foodmart 2000.

Case1: Using Calculated Members
with
member measures.a as '[Unit Sales]',format_string='#,##0%'
member measures.b as '[Unit Sales]',format_string='##0'
member measures.c as 'iif([Unit Sales] > 7000, a, b)'
select
{a, b, c, [Measures].[Unit Sales]} on columns,
order(except([Promotion Media].[Media Type].members,{[Promotion
Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rows
from Sales

Case2: Using Calculated Cells
with
cell calculation [Unit Sales<7000] FOR '({[Unit Sales]})' AS
'CalculationPassValue([Unit Sales],-1,Relative)',
CONDITION='CalculationPassValue([Unit Sales],-1,Relative)<7000',
FORMAT_STRING='#,##0"%"'
cell calculation [Unit Sales>=7000] FOR '({[Unit Sales]})' AS
'CalculationPassValue([Unit Sales],-1,Relative)',
CONDITION='CalculationPassValue([Unit Sales],-1,Relative)>=7000',
FORMAT_STRING='Currency'
select
{[Measures].[Unit Sales]} on columns,
order(except([Promotion Media].[Media Type].members,{[Promotion
Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rows
from Sales

Ohjoo



"Sam" <msam77 (AT) gmail (DOT) com> wrote in message
news:1167954102.176990.274750 (AT) v33g2000cwv (DOT) googlegroups.com...
Thanks But it does not work in AS 2000.

Do you have any another ideas?

Sameer


Ohjoo Kwon wrote:
Next if-format works in AS 2005, but I do not test it in AS 2000.

Format_String=IIF(..., '#,#', '#,#.0 "%"')

Ohjoo

"Sam" <msam77 (AT) gmail (DOT) com> wrote in message
news:1167347019.088797.265000 (AT) 73g2000cwn (DOT) googlegroups.com...
Below is my Calculated members:

iif(Measures.currentmember is [Measures].[Rx Base] OR
Measures.currentmember is [Measures].[Photo Base] OR
Measures.currentmember is [Measures].[Total Triple Base] OR
Measures.currentmember is [Measures].[Wait Time Base],
SUM([Time].[Year].[2005].Children,
Round(Measures.CurrentMember)),Avg([Time].[Year].[2005].Children,
Round(Measures.CurrentMember*100,0)))

I have "Solve Order" of 10.

For AVG the value for the cell is "85.4" but I wanted it to be "85.4%"
But for SUM it should be just the normal. So If I change the
"Format_String" then it change my SUM value too.


Any help will be really appreciate!!!
Sam




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.