dbTalk Databases Forums  

Conditional Colouring

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


Discuss Conditional Colouring in the microsoft.public.sqlserver.olap forum.



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

Default Conditional Colouring - 02-15-2004 , 06:48 PM






Hi,

Is it possible to use conditional colouring to highlight cells whose value
is greater than the average for a dimension level?
For example, in a cellset such as the following (where construction,
decorating, electrical and hardware are children of Retail)

Retail: 100
Construction: 25
Decorating: 25
Electrical: 2
Hardware: 48

I would like to highlight the cells next to Hardware, since its total is
greater than the average for Retail. Is this possible using MDX? If so, how
might I do it?

Peter



Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: Conditional Colouring - 02-15-2004 , 09:32 PM






It's possible, if your client supports this server-driven feature. It is
defined by placing an MDX expression such as below in the backcolor property
of a calculated member.

IIF ( [Measures].CurrentMember < 0,
VBA!RGB(255, 0, 0),
VBA!RGB(0, 0, 0) )

Search this group for "backcolor" for more examples.

public @ the domain below
www.tomchester.net

"Peter Kenyon" <p.kenyon.no.spam (AT) paradise (DOT) net.nz> wrote

Quote:
Hi,

Is it possible to use conditional colouring to highlight cells whose value
is greater than the average for a dimension level?
For example, in a cellset such as the following (where construction,
decorating, electrical and hardware are children of Retail)

Retail: 100
Construction: 25
Decorating: 25
Electrical: 2
Hardware: 48

I would like to highlight the cells next to Hardware, since its total is
greater than the average for Retail. Is this possible using MDX? If so,
how
might I do it?

Peter





Reply With Quote
  #3  
Old   
Peter Kenyon
 
Posts: n/a

Default Re: Conditional Colouring - 02-16-2004 , 05:19 PM




"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote

Quote:
It's possible, if your client supports this server-driven feature. It is
defined by placing an MDX expression such as below in the backcolor
property
of a calculated member.

IIF ( [Measures].CurrentMember < 0,
VBA!RGB(255, 0, 0),
VBA!RGB(0, 0, 0) )
Thanks. Is it possible to use an MDX expression to compare the value of the
current cell to adjacent cells? For example, if I am displaying profit for
various customers I would like to highlight them if they are greater than
the average for that category of customer. In other words, instead of:

IIF([Measures].CurrentMember > 5000 ........

I would like to have something like the following:

IIF([Measures].CurrentMember > Avg({Axis(1).CurrentMember.Siblings},
[Measures].CurrentMember),
VBA!RGB(255,0,0),
VBA!RGB(255,255,255))

Except that Axis(1) is not an alias for a dimension, so it doesn't work. Is
there any way to achieve this using MDX? If so, how can I do it?

Thanks,

Peter




Reply With Quote
  #4  
Old   
Tom Chester
 
Posts: n/a

Default Re: Conditional Colouring - 02-16-2004 , 06:01 PM



I've never tried to use the axis function in the backcolor property. I do
know that when you create a calc member in the cube editor that it is
neccesary to wrap it with StrToSet(), like so:

WITH MEMBER Measures.[Visual Rank] AS
'RANK(
StrToSet("Axis(1)").Item(0).Item(0).Dimension.Curr entMember,
Order(StrToSet("Axis(1)"),
StrToSet("Axis(0)").item(0).item(0), bdesc) ) '

public @ the domain below
www.tomchester.net

"Peter Kenyon" <p.kenyon.no.spam (AT) paradise (DOT) net.nz> wrote

Quote:
"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote in message
news:sRWXb.45$pM3.111917 (AT) news (DOT) uswest.net...
It's possible, if your client supports this server-driven feature. It is
defined by placing an MDX expression such as below in the backcolor
property
of a calculated member.

IIF ( [Measures].CurrentMember < 0,
VBA!RGB(255, 0, 0),
VBA!RGB(0, 0, 0) )

Thanks. Is it possible to use an MDX expression to compare the value of
the
current cell to adjacent cells? For example, if I am displaying profit for
various customers I would like to highlight them if they are greater than
the average for that category of customer. In other words, instead of:

IIF([Measures].CurrentMember > 5000 ........

I would like to have something like the following:

IIF([Measures].CurrentMember > Avg({Axis(1).CurrentMember.Siblings},
[Measures].CurrentMember),
VBA!RGB(255,0,0),
VBA!RGB(255,255,255))

Except that Axis(1) is not an alias for a dimension, so it doesn't work.
Is
there any way to achieve this using MDX? If so, how can I do it?

Thanks,

Peter





Reply With Quote
  #5  
Old   
Peter Kenyon
 
Posts: n/a

Default Re: Conditional Colouring - 02-17-2004 , 05:25 PM




"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote

Quote:
I've never tried to use the axis function in the backcolor property. I do
know that when you create a calc member in the cube editor that it is
neccesary to wrap it with StrToSet(), like so:

WITH MEMBER Measures.[Visual Rank] AS
'RANK(
StrToSet("Axis(1)").Item(0).Item(0).Dimension.Curr entMember,
Order(StrToSet("Axis(1)"),
StrToSet("Axis(0)").item(0).item(0), bdesc) ) '

public @ the domain below
www.tomchester.net

Great, that was all the information I needed. I've got it working now with
this expression:
iif([Measures].CurrentMember >
Avg(StrToSet("Axis(1)").Item(0).Item(0).Dimension. CurrentMember.Siblings,
[Measures].CurrentMember), VBA!RGB(0, 255, 0), VBA!RGB(255,255,255))




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.