BookmarkSubscribeRSS Feed
JDMTX
Fluorite | Level 6
Does anyone know of a method to set color preferences in either WRS or Information Map Studio to assign fixed colors to a categorical data field based upon a distinct set of values. In my industry specific colors represent specific business conditions or competitors and it is critical that I maintain this consistency in WRS.

Many thanks and it is great to see a forum setup to support WRS!!!
13 REPLIES 13
AngelaHall
SAS Employee
Of course 'Conditional Highlighting' is available, but this only works for numeric values.

For categorical variables, I am familar with using custom SAS formats in Stored Processes to output colors, but I'll need to test whether the same custom SAS formats would be read correctly by the IMAP & WRS report.

~ Angela Hall
http://sas-bi.blogspot.com
AngelaHall
SAS Employee
Okay. I was able to figure this out!

You will need to create a new column (or overwrite the existing) in your data table and include the categorical value surrounded by HTML tags to create the color.

Such as font color=RED Canada /font
(with proper less than / greater than signs around the HTML tags)

Then in the information map, you will need to use this column for your reports & check the box called 'Display as a hyperlink' in the classification aggregation format property screen of that data element.

I'll post a blog post about this next Monday with some screenshots to help explain.

~ Angela Hall
http://sas-bi.blogspot.com Message was edited by: Angela Hall
JDMTX
Fluorite | Level 6
I am extremely excited by your finding!!! It does bring a couple of questions to mind:

1. What is the practicality of assigning the colors to the categorical data via means of a format or macro?
2. What is the practicality of loading the assignment of colors into a support data set and join the support data set to the reporting data set via Information Map Studio?
3. Is it correct to assume that once data from the workspace server is handed off to the middle tier of a BI Server implementation that the rendering of the data into a report is exclusively handled by a Java application? If so this brings about interesting possibilities via the use of mods....

Many thanks and I look forward to reading about the solution in the blog!!!
AngelaHall
SAS Employee
I tried the user defined formatted value first, but none of the html tags were handled properly. So then I tried the user defined format with the checkbox for hyperlink displays, and that also didnt work. A macro might be possible, but it would need to convert the values before the data is displayed to the user.

I would think that the support data set joining into each needed information map is possibly the best practice since it would be standardized/consistent, however there could be performance problems with completing this join each & every time. You'll have to weigh the advantages & disadvantages.

3 - We'd have to get the WRS developers to weigh in on the actual technology, but from my testing I'd assume that you are correct.

~ Angela Hall
http://sas-bi.blogspot.com

(btw - supporting images are scheduled to post to my blog on Monday, 1/25/2010.)
Jenn2
SAS Employee
3. Is it correct to assume that once data from the workspace server is handed off to the middle tier of a BI Server implementation that the rendering of the data into a report is exclusively handled by a Java application? If so this brings about interesting possibilities via the use of mods....

Yes, rendering is done in java at mid-tier level and data is handed to the rendering object based on user selection.
JDMTX
Fluorite | Level 6
Can this same technique be applied to produce graphs as opposed to tables? Think a pie chart where each slice represents revenues by region and each region is typically assigned a fixed color.
AngelaHall
SAS Employee
Unfortunately no. The text isn't converted to HTML when using a graph element.
So the labels would be the exact same text as the data (or format) element - including all the html font color tags, etc.
Jenn2
SAS Employee
JDMTX,
We've been discussing the ability to assign different colors to categorical variables in tables and charts via conditional highlighting. Currently, in WRS v3.1 and v4.2, there is no way to highlight categorical varibles through WRS. Angela presents the only way I know of to change colors but if you create a new report, I believe you have to go back in and change the colors again. Angela, correct me if I'm wrong.

Can you tell me how much of a need you have to be able to assign colors to categorical variables in charts and tables? Is there a critical need?

Thanks,
Jen
AngelaHall
SAS Employee
These categorical colors would be available anytime that information map was used. So any new WRS report off the same information map would have these colors available within the tables.

If you wanted to modify the colors themselves, you would need to do that in the HTML tags within the actual data table.

~ Angela Hall
http://sas-bi.blogspot.com
Jenn2
SAS Employee
Oh, I see. But change information maps and you have to change the coloring again.
JDMTX
Fluorite | Level 6
Jenn2 wrote "Can you tell me how much of a need you have to be able to assign colors to categorical variables in charts and tables? Is there a critical need? "

From my perspective, this is a high priority item based upon how my users create and read reports. We are a multinational company with operations in 90 plus countries and currently use custom color schemes for competitors, product categories and regions. The bulk of these reports currently reside in MS Excel and MS PowerPoint were the use fixed color schemes for categorical data enable users to rapidly review and interpret reports without having to refer to legends.

Based upon how graphs are generated, I am surprised that it is not possible to create a custom style sheet that can be tacked onto the default theme and thus be used to override selected categorical values when graphics are rendered.

To put this into context, I offer two examples:

Think of cities being able to define their own custom colors for stop lights. It would not work because both the colors and position of the lights in the lighting unit have distinct universal meanings.

You have three product lines and four regions yet in one of the four regions only two of the product lines are available. If a users puts the four graphs side by side in WRS it is possible for the slices of the pie chart to be different colors since the rendering engine is deciding what colors to use for you.
Jenn2
SAS Employee
Thank you so much JDMTX. We have been proponents for this suggestion but we have had trouble with the "under the covers" mechanisms to make it happen. It always helps to hear customers explain what they need it for, how important it is, etc. to see how we can accommodate the user's needs. Thank you very much. This was incredibly valuable.
JDMTX
Fluorite | Level 6
You are more than welcome and please continue to advocate this need with the development staff as it would be an incredible useful feature.

We are moving our BI Server 9.2 into full production tonight and I had some freetime to look at the "under the cover" mechanisms that you reference and I see your point. It appears that you are using Dojo to generate a static graphic and then use the image id to associate data set values using the area attribute of the map tag. Very Cool!!! Downside is it seems that the current implementation does not support the ability to pass a custom style sheet that is associated with categorical data to the graphing engine. Anyway, have to get back to the server move.

Many Thanks,

JDMTX

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 1230 views
  • 0 likes
  • 3 in conversation