dbTalk Databases Forums  

Conditional Formatting on Measure?

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


Discuss Conditional Formatting on Measure? in the microsoft.public.sqlserver.olap forum.



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

Default Conditional Formatting on Measure? - 07-21-2006 , 11:48 AM






I have a measure that is defined with an aggregationFunction of ByAccount.

The Field (Target Threshold) can either be summed, average, or LastChild.
All is fine and working.

However, how can I conditionally format this to show ('n/v') if no value,
"##.##%" if an average, or "##,##" if summed.

I have written the logic below to do this using a calculated measure. This
works. However, it is slower. So, is there a way to trap the value AFTER the
BYACCOUNT
has been applied but BEFORE it is displayed?

My calculated measure is below:


IIF ( ISEMPTY([Measures].[Target Threshold]),
'N/V',
FORMAT(
Case when [KPI Type].CURRENTMEMBER.Name = 'R' then max([Measures].[Target
Threshold])
when [KPI Type].CURRENTMEMBER.Name = 'P' then AVG([Measures].[Target
Threshold])/100
when [KPI Type].CURRENTMEMBER.Name = 'N' then sum([Measures].[Target
Threshold]) end,
[KPI Format].CURRENTMEMBER.Name)
)

Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: Conditional Formatting on Measure? - 07-21-2006 , 01:03 PM







"SteveM" <SteveM (AT) discussions (DOT) microsoft.com> wrote

Perhaps you could use something like that in MDX Script:

format_string(Measures.ByAccount) = "##.##"
format_string([KPI Type].[KPI Type].[R], Measures.ByAccount) = "##.##%"

==============================Â*================== ==
Mosha Pasumansky - http://www.mosha.com/msolap
Analysis Services blog at http://www.sqljunkies.com/WebLÂ*og/mosha
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==============================Â*================== ==

Quote:
I have a measure that is defined with an aggregationFunction of ByAccount.

The Field (Target Threshold) can either be summed, average, or LastChild.
All is fine and working.

However, how can I conditionally format this to show ('n/v') if no value,
"##.##%" if an average, or "##,##" if summed.

I have written the logic below to do this using a calculated measure. This
works. However, it is slower. So, is there a way to trap the value AFTER
the
BYACCOUNT
has been applied but BEFORE it is displayed?

My calculated measure is below:


IIF ( ISEMPTY([Measures].[Target Threshold]),
'N/V',
FORMAT(
Case when [KPI Type].CURRENTMEMBER.Name = 'R' then max([Measures].[Target
Threshold])
when [KPI Type].CURRENTMEMBER.Name = 'P' then AVG([Measures].[Target
Threshold])/100
when [KPI Type].CURRENTMEMBER.Name = 'N' then sum([Measures].[Target
Threshold]) end,
[KPI Format].CURRENTMEMBER.Name)
)


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

Default Re: Conditional Formatting on Measure? - 07-23-2006 , 06:18 AM



And to handle the "n/v" requirement you could use the 4 part format
string syntax as noted in BOL at:

http://msdn2.microsoft.com/en-us/library/ms146084.aspx

eg.

"##.##;-##;##;0;\n\/\v"

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <44c116e5$1 (AT) news (DOT) microsoft.com>, moshap (AT) online (DOT) microsoft.com
says...
Quote:
"SteveM" <SteveM (AT) discussions (DOT) microsoft.com> wrote in message
news:208547D4-FFB3-4422-9769-39DBDC0555E2 (AT) microsoft (DOT) com...
Perhaps you could use something like that in MDX Script:

format_string(Measures.ByAccount) = "##.##"
format_string([KPI Type].[KPI Type].[R], Measures.ByAccount) = "##.##%"

==============================Â*================== ==
Mosha Pasumansky - http://www.mosha.com/msolap
Analysis Services blog at http://www.sqljunkies.com/WebLÂ*og/mosha
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==============================Â*================== ==

I have a measure that is defined with an aggregationFunction of ByAccount.

The Field (Target Threshold) can either be summed, average, or LastChild.
All is fine and working.

However, how can I conditionally format this to show ('n/v') if no value,
"##.##%" if an average, or "##,##" if summed.

I have written the logic below to do this using a calculated measure. This
works. However, it is slower. So, is there a way to trap the value AFTER
the
BYACCOUNT
has been applied but BEFORE it is displayed?

My calculated measure is below:


IIF ( ISEMPTY([Measures].[Target Threshold]),
'N/V',
FORMAT(
Case when [KPI Type].CURRENTMEMBER.Name = 'R' then max([Measures].[Target
Threshold])
when [KPI Type].CURRENTMEMBER.Name = 'P' then AVG([Measures].[Target
Threshold])/100
when [KPI Type].CURRENTMEMBER.Name = 'N' then sum([Measures].[Target
Threshold]) end,
[KPI Format].CURRENTMEMBER.Name)
)



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.