dbTalk Databases Forums  

CELL CALCULATION , Condition and FORMAT_STRING Problem

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


Discuss CELL CALCULATION , Condition and FORMAT_STRING Problem in the microsoft.public.sqlserver.olap forum.



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

Default CELL CALCULATION , Condition and FORMAT_STRING Problem - 03-15-2006 , 10:26 AM






Hi ,

I want applying cell calculaltion and using condition for changing the
fore_color property
of the Cell. I want to apply FORMAT_STRING irrespective of the
condition. Is it possible to apply a specific format irrespective of
condition ?

Currently , it is applying FORMAT_STRING propertty when condition
evaluates to true.

Regards,

Faraz

Thanks in Advance

----------------------------------------------------------------------------------------------------------------------
-- Q U E R Y F O R F O R M A T
----------------------------------------------------------------------------------------------------------------------
With Cell Calculation MY_CELL For
'( { [Measures].[Sales Count]} )' As
'CalculationPassValue(Measures.CurrentMember, -1 ,Relative )',
CONDITION =' CalculationPassValue((ParallelPeriod ([Time].[Month],
1,[Time].CurrentMember),Measures.[Sales Count]), -1, RELATIVE) * 0.95
< CalculationPassValue( [Measures].[Sales Count], -1,Relative ) ',
SOLVE_ORDER ='2000', FORE_COLOR ='11005',
CALCULATION_PASS_NUMBER ='2', CALCULATION_PASS_DEPTH ='1' ,
FORMAT_STRING='#,##0.00'
SELECT
{ CrossJoin({[Customers].[Country].[USA].CHILDREN},
{Measures.[Sales Count]})} ON COLUMNS ,
{{[Time].[Month].MEMBERS}} ON ROWS
FROM [Sales] CELL PROPERTIES
[VALUE],[FORMATTED_VALUE],[CELL_ORDINAL],[FORE_COLOR

------------------------------------------------------------------------------------------------------------------------


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

Default RE: CELL CALCULATION , Condition and FORMAT_STRING Problem - 03-15-2006 , 10:58 PM






One option would be to incorporate the condition within the color expression:

Quote:
With Cell Calculation MY_CELL For
'( { [Measures].[Sales Count]} )' As
'CalculationPassValue(Measures.CurrentMember, -1 ,Relative )',
FORE_COLOR =' iif(CalculationPassValue((ParallelPeriod ([Time].[Month],
1,[Time].CurrentMember),Measures.[Sales Count]), -1, RELATIVE) * 0.95
< CalculationPassValue( [Measures].[Sales Count], -1,Relative ),
11005, 0) ',
SOLVE_ORDER ='2000',
CALCULATION_PASS_NUMBER ='2', CALCULATION_PASS_DEPTH ='1' ,
FORMAT_STRING='#,##0.00'
SELECT
{ CrossJoin({[Customers].[Country].[USA].CHILDREN},
{Measures.[Sales Count]})} ON COLUMNS ,
{{[Time].[Month].MEMBERS}} ON ROWS
FROM [Sales] CELL PROPERTIES
[VALUE],[FORMATTED_VALUE],[CELL_ORDINAL],
[FORE_COLOR]
Quote:

"Faraz" wrote:

Quote:
Hi ,

I want applying cell calculaltion and using condition for changing the
fore_color property
of the Cell. I want to apply FORMAT_STRING irrespective of the
condition. Is it possible to apply a specific format irrespective of
condition ?

Currently , it is applying FORMAT_STRING propertty when condition
evaluates to true.

Regards,

Faraz

Thanks in Advance

----------------------------------------------------------------------------------------------------------------------
-- Q U E R Y F O R F O R M A T
----------------------------------------------------------------------------------------------------------------------
With Cell Calculation MY_CELL For
'( { [Measures].[Sales Count]} )' As
'CalculationPassValue(Measures.CurrentMember, -1 ,Relative )',
CONDITION =' CalculationPassValue((ParallelPeriod ([Time].[Month],
1,[Time].CurrentMember),Measures.[Sales Count]), -1, RELATIVE) * 0.95
CalculationPassValue( [Measures].[Sales Count], -1,Relative ) ',
SOLVE_ORDER ='2000', FORE_COLOR ='11005',
CALCULATION_PASS_NUMBER ='2', CALCULATION_PASS_DEPTH ='1' ,
FORMAT_STRING='#,##0.00'
SELECT
{ CrossJoin({[Customers].[Country].[USA].CHILDREN},
{Measures.[Sales Count]})} ON COLUMNS ,
{{[Time].[Month].MEMBERS}} ON ROWS
FROM [Sales] CELL PROPERTIES
[VALUE],[FORMATTED_VALUE],[CELL_ORDINAL],[FORE_COLOR

------------------------------------------------------------------------------------------------------------------------



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.