dbTalk Databases Forums  

Format_String & Scope Statement

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


Discuss Format_String & Scope Statement in the microsoft.public.sqlserver.olap forum.



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

Default Format_String & Scope Statement - 12-14-2005 , 01:23 AM






Hello

I was wondering if anyone could offer some advice on the following
issues with SQL AS 2005:

I have the following code and am trying to get Format_String to work
properly. It works fine until I put a scope statement into the mix -
after which format_string seems not to work. Other properties like
back_color continue to work in MS Vis Studio browser. Anyone have
any ideas as to why or how to get my format back?

Regards

jph

--BASE RAW % CHANGE MEASURE
CREATE MEMBER CURRENTCUBE.[MEASURES].[% Change]
AS "NA",
FORMAT_STRING = "#.#%;(#.#%);0.00",
BACK_COLOR = 65535 /*Yellow*/,
VISIBLE = 1 ;

--FOR QUARTERS
SCOPE( [Dates].[Year - Quarter -
Month].[QUARTER].MEMBERS,[MEASURES].[% CHANGE] );
this = (closingperiod([dates].[year - quarter -
month].[month]),measures.[raw % change]);
END SCOPE;
--FOR MONTHS
SCOPE( [Dates].[Year - Quarter -
Month].[MONTH].MEMBERS,[MEASURES].[% CHANGE] );
this = [MEASURES].[RAW % CHANGE];

END SCOPE;



Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Format_String & Scope Statement - 12-14-2005 , 05:18 AM






Have you tried putting the format string inside the scope statment? I am
not sure, but I am just wondering if it is pulling the format from the
raw measure.

eg.

--BASE RAW % CHANGE MEASURE
CREATE MEMBER CURRENTCUBE.[MEASURES].[% Change]
AS "NA",
FORMAT_STRING = "#.#%;(#.#%);0.00",
BACK_COLOR = 65535 /*Yellow*/,
VISIBLE = 1 ;

--FOR QUARTERS
SCOPE( [Dates].[Year - Quarter -
Month].[QUARTER].MEMBERS,[MEASURES].[% CHANGE] );
this = (closingperiod([dates].[year - quarter -
month].[month]),measures.[raw % change]);

Format_String ( This ) = "#.#%;(#.#%);0.00" ;

END SCOPE;

--FOR MONTHS
SCOPE( [Dates].[Year - Quarter -
Month].[MONTH].MEMBERS,[MEASURES].[% CHANGE] );
this = [MEASURES].[RAW % CHANGE];

Format_String ( This ) = "#.#%;(#.#%);0.00" ;

END SCOPE;


--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <5shvp19vvuivapv21v73l4ic65ovorbb00 (AT) 4ax (DOT) com>,
mma (AT) nospam (DOT) nospan says...
Quote:
Hello

I was wondering if anyone could offer some advice on the following
issues with SQL AS 2005:

I have the following code and am trying to get Format_String to work
properly. It works fine until I put a scope statement into the mix -
after which format_string seems not to work. Other properties like
back_color continue to work in MS Vis Studio browser. Anyone have
any ideas as to why or how to get my format back?

Regards

jph

--BASE RAW % CHANGE MEASURE
CREATE MEMBER CURRENTCUBE.[MEASURES].[% Change]
AS "NA",
FORMAT_STRING = "#.#%;(#.#%);0.00",
BACK_COLOR = 65535 /*Yellow*/,
VISIBLE = 1 ;

--FOR QUARTERS
SCOPE( [Dates].[Year - Quarter -
Month].[QUARTER].MEMBERS,[MEASURES].[% CHANGE] );
this = (closingperiod([dates].[year - quarter -
month].[month]),measures.[raw % change]);
END SCOPE;
--FOR MONTHS
SCOPE( [Dates].[Year - Quarter -
Month].[MONTH].MEMBERS,[MEASURES].[% CHANGE] );
this = [MEASURES].[RAW % CHANGE];

END SCOPE;





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

Default Re: Format_String & Scope Statement - 12-15-2005 , 02:17 AM



Thanks
Works nicely. I scoured the docs for something like this - where
would you find a reference to it?

P.S. Any reason Excel 2003 does not take the formatting at all - no
matter how it is specified?

mma

On Wed, 14 Dec 2005 22:18:52 +1100, Darren Gosbell
<jam (AT) newsgroups (DOT) nospam> wrote:

Quote:
Have you tried putting the format string inside the scope statment? I am
not sure, but I am just wondering if it is pulling the format from the
raw measure.

eg.

--BASE RAW % CHANGE MEASURE
CREATE MEMBER CURRENTCUBE.[MEASURES].[% Change]
AS "NA",
FORMAT_STRING = "#.#%;(#.#%);0.00",
BACK_COLOR = 65535 /*Yellow*/,
VISIBLE = 1 ;

--FOR QUARTERS
SCOPE( [Dates].[Year - Quarter -
Month].[QUARTER].MEMBERS,[MEASURES].[% CHANGE] );
this = (closingperiod([dates].[year - quarter -
month].[month]),measures.[raw % change]);

Format_String ( This ) = "#.#%;(#.#%);0.00" ;

END SCOPE;

--FOR MONTHS
SCOPE( [Dates].[Year - Quarter -
Month].[MONTH].MEMBERS,[MEASURES].[% CHANGE] );
this = [MEASURES].[RAW % CHANGE];

Format_String ( This ) = "#.#%;(#.#%);0.00" ;

END SCOPE;


Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Format_String & Scope Statement - 12-16-2005 , 03:32 AM



Quote:
Thanks
Works nicely. I scoured the docs for something like this - where
would you find a reference to it?
I noticed this in the AdventureWorks sample database.

Quote:
P.S. Any reason Excel 2003 does not take the formatting at all - no
matter how it is specified?

Yes, I don't think it supports formatting natively. I think OWC does,
but not the built-in Excel Pivot tables. Have you had a look at the
Office Web components toolpack? It has samples on enabling Cell coloring
and drillthrough, maybe it can be extended to formatting?

http://www.microsoft.com/downloads/d...BEB5D477-2100-
4586-A13C-50E56F101720&displaylang=en

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell


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.