<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Colour Columns as Data Bars and by Using Conditional Formatting in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254879#M15354</link>
    <description>&lt;P&gt;I think you need PROC SGPLOT to get a image ,NOT a excel file .&lt;/P&gt;
&lt;P&gt;OR you need call define() + style={preimage=....} , but that is very hard to code and need many image to display it .&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2016 01:21:41 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-03-07T01:21:41Z</dc:date>
    <item>
      <title>How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254871#M15353</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to make "Data Bars" and&amp;nbsp;"Conditional Fromatting" in SAS, which we can do in Excel. I have a similar image which is created in Excel as follows. Excel helps us by the following steps -&amp;gt; Style-&amp;gt;Conditional Formatting -&amp;gt;Data Bars. &amp;nbsp;I prepared a sample data. If it is possible, I would like&amp;nbsp;to see last two columns the image as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data Have;&lt;BR /&gt;Length Characteristics $ 20 Dev 8 Model 8 Val 8 ModelDev 8 DevVal 8 ;&lt;BR /&gt;Infile Datalines Missover;&lt;BR /&gt;Input Characteristics Dev Model Val ModelDev DevVal;&lt;BR /&gt;Datalines;&lt;BR /&gt;WOE_variable_1 0.1 0.1 0.1 0.1 0.7&lt;BR /&gt;WOE_variable_2 0.1 0.1 0.1 0.1 0.3&lt;BR /&gt;WOE_variable_3 0.1 0.1 0.1 -0.1 0.1&lt;BR /&gt;WOE_variable_4 0.1 0.1 0.1 0.1 0.5&lt;BR /&gt;WOE_variable_5 0.1 0.1 0.1 0.1 0.1&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC FORMAT;&lt;BR /&gt;picture pctpic (round) low-&amp;lt;0 ='009.99%' (prefix='-' mult=10000)&lt;BR /&gt;0-high='009.99%' (mult=10000)&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PROC REPORT Data=Have;&lt;BR /&gt;&lt;BR /&gt;Column Characteristics ("IV" Dev Model Val) ModelDev DevVal;&lt;BR /&gt;&lt;BR /&gt;Define Characteristics / Display "Characteristics (Variables)";&lt;BR /&gt;Define Dev / Display "Dev" STYLE(column)={backgroundcolor=Yellow};&lt;BR /&gt;Define Model / Display "Model" STYLE(column)={backgroundcolor=Yellow};&lt;BR /&gt;Define Val / Display "Val" STYLE(column)={backgroundcolor=Yellow};&lt;BR /&gt;Define ModelDev / Display "Difference of IV / Model - Dev" Format= pctpic.;&lt;BR /&gt;Define DevVal / Display "Difference of IV / Dev - Val" Format= Percent7.2;&lt;BR /&gt;&lt;BR /&gt;/*Compute ModelDev;*/&lt;BR /&gt;/*Call Define(_col_,'style',*/&lt;BR /&gt;&lt;BR /&gt;Run;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2211iDB2A3FA2A968F5A5/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Report.png" title="Report.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2016 23:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254871#M15353</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-03-06T23:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254879#M15354</link>
      <description>&lt;P&gt;I think you need PROC SGPLOT to get a image ,NOT a excel file .&lt;/P&gt;
&lt;P&gt;OR you need call define() + style={preimage=....} , but that is very hard to code and need many image to display it .&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 01:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254879#M15354</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-07T01:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254892#M15355</link>
      <description>&lt;P&gt;Hello Xia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, I was trying to ask that how to show horizontal bar in column's cells while we use PROC REPORT procedure or by the help of any other procedures. I mean I don't want to add a image into cells. I think I can create a report by using PROC SGPLOT as below but how can I show it in a table, into cell ? Are there any possibilities ? I just wanted to indicate that to make clear. If it is still not possible I can understand .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2212i2E81881FB12E8F67/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Farklı Kaydet.png" title="Farklı Kaydet.png" width="383" height="253" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 07:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254892#M15355</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-03-07T07:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254897#M15356</link>
      <description>&lt;P&gt;Oh. As far as I know, that is almost impossible . Maybe Cynthia have some idea . Calling Cynthia .......&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 08:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254897#M15356</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-07T08:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254898#M15357</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at this paper &lt;A href="http://support.sas.com/resources/papers/proceedings09/221-2009.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings09/221-2009.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It shows how to create the graphs first, and then add it to your report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 09:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254898#M15357</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-03-07T09:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254912#M15358</link>
      <description>&lt;P&gt;Hello Bruno,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for trying to help me, I checked the Web Site link. Actually, I'm little bir confused in Data Anno part. I wrote the datas in my enivorenment but I couldn't exactly get it. Can&amp;nbsp;anybody help me for the following codes ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Ranks;
Length RateRank 8  SchDist $ 20 VarCount 8 VarRate 8;
Infile Datalines Missover;
Input RateRank SchDist VarCount VarRate;
Datalines;
1 Auburn 523 720
2 Seattle 3425 560
3 Higline 662 543
4 SouthCentral 90 539
5 Kent 785 524
6 Renton 429 407
7 Shoreline 225 334
8 FederalWay 424 338
9 Tahoma 69 198
10 SnoqualmieValley 61 183
;
Run;

PROC REPORT data=Ranks nowd;
	Columns RateRank SchDist
	("Selected Measure" VarCount VarRate);
Define RateRank / "Rank" group style=[background=ColorList. foreground=TextColor.];
Define SchDist / "School District";
Define VarCount / "Count";
Define VarRate / "Rate";
RUN;

Proc Format;
	Value ColorList
	1-3="cxff0000"
	4-6="cxff9999"
	7-10="cxffeeb8"
	11-13="cx9999ff"
	14-16="cx0000ff"
	17-19="white";
	Value TextColor
	1,2,3='white'
	other='black';
RUN;

/*
Data Anno;
%Bar(0,0,100,100,black,0,e);
%Bar(0,10,75,90,cxff0000,0,s);
%Bar(75,50,0,360,6,black,s,3);
Run;

filename Bar "...\Highline.gif";
goptions device=gif gsfname=bar hsize=1.5in vsize=.2in;

Proc gslide Anno=Anno;
Run;
Quit;*/

PROC REPORT data=Ranks nowd;
	Columns RateRank SchDist
	("Selected Measure" VarCount VarRate);
Define RateRank / "Rank" group ;
Define SchDist / group "School District";
Define VarCount / "Count";
Define VarRate / "Rate";
/*Define ShowBar / "Relative Rate" computed;

compute ShowBar / char;
	call define(_col_,'style',"style=[preimage='"||SchDist||".gif']");
endcomp;*/
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 10:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254912#M15358</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-03-07T10:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254970#M15359</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to create a graph for each school district. An then include those graphs in the Proc REPORT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the example below, it just creates the one graph which is used for all the schools.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close;

Data Ranks;
  Length RateRank 8  SchDist $ 20 VarCount 8 VarRate 8;
  Infile Datalines Missover;
  Input RateRank SchDist VarCount VarRate;
  Datalines;
1 Auburn 523 720
2 Seattle 3425 560
3 Higline 662 543
4 SouthCentral 90 539
5 Kent 785 524
6 Renton 429 407
7 Shoreline 225 334
8 FederalWay 424 338
9 Tahoma 69 198
10 SnoqualmieValley 61 183
;
Run;

*
* load all the SAS/GRAPH macros
*;
%annomac


Data Anno;
*
* declare the variables used by the annotate macros
*;
%dclanno

*
* set the coordinate system, in our case % of graphics area
*;
xsys="3";
ysys="3";
*
* set how to measure size for text (pt)
*;
hsys="D";
*
* use macros to create two bars and a text
*;
%Bar(0,0,100,100,cx0000ff,0,e);
%Bar(0,0,75,100,cxff0000,0,s);
%LABEL(100, 50, "75", cx000000, 0, 0, 8, none , &amp;lt;); 

Run;

ods listing;
OPTIONS printerpath=postscript;

filename bar 'c:\temp\barsample.png';
goptions reset=all;
goptions
  device=png gsfname=bar
  xpixels=100 ypixels=25;
;

Proc gslide Anno=Anno;
Run;

Quit;

ods listing close;


Proc Format;
  Value ColorList
    1-3="cxff0000"
    4-6="cxff9999"
    7-10="cxffeeb8"
    11-13="cx9999ff"
    14-16="cx0000ff"
    17-19="white"
  ;
  Value TextColor
    1,2,3='white'
    other='black'
  ;
RUN;

ods html file="c:\temp\sample.html";

PROC REPORT data=Ranks nowd;
  Columns RateRank SchDist
    ("Selected Measure" VarCount VarRate);
  Define RateRank / "Rank" group style=[background=ColorList. foreground=TextColor.];
  Define SchDist / "School District";
  Define VarCount / "Count";
  Define VarRate / "Rate";
RUN;


PROC REPORT data=Ranks nowd;
  Columns RateRank SchDist
    ("Selected Measure" VarCount VarRate)
    showBar
  ;
  Define RateRank / "Rank" group;
  Define SchDist / group "School District";
  Define VarCount / "Count";
  Define VarRate / "Rate";
  Define ShowBar / "Relative Rate" computed;

  compute ShowBar / char;
    call define(_col_,'style',"style=[preimage='c:\temp\barsample.png']");
  endcomp;
Run;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 15:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254970#M15359</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-03-07T15:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254987#M15360</link>
      <description>&lt;P&gt;Bruno,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much. Can you share with me the barsample.png, please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 16:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/254987#M15360</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-03-07T16:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Colour Columns as Data Bars and by Using Conditional Formatting</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/255106#M15362</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to apologise to you. I was very busy today. Now, I checked your code again in more detailed and I understood better. Thank you very much. I'm going to try some addtional things on your code. If I can do it I'll accept your answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot again.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 21:36:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-Colour-Columns-as-Data-Bars-and-by-Using-Conditional/m-p/255106#M15362</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-03-07T21:36:20Z</dc:date>
    </item>
  </channel>
</rss>

