<?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 Characterizing rows with colurs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94556#M290157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I wish to write a code that evaluates the value of&amp;nbsp; three variables.&lt;/P&gt;&lt;P&gt;I want to do thus that if each of the three variable's value is negaitv, than &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; valuescolurs turn red ( this is to be done when I am doing a proc report if possible).&lt;/P&gt;&lt;P&gt;If two of the variable's value are negativ and one is positive, then all the values turn yellow.&lt;/P&gt;&lt;P&gt;If two of the varible's value are positiv and one is negative, then all the values turn blue&lt;/P&gt;&lt;P&gt;And if all the variable's value are positive, then they all turn green. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if you look at the attached file I would want all the &lt;SPAN style="text-decoration: underline;"&gt;values&lt;/SPAN&gt; in that row to turn blue ( you can just ignore the variable performance 2010, so there is only 3 variables).&lt;/P&gt;&lt;P&gt;Is this possible? &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11224i61B4F31DF6BF54F7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Indicator.PNG" title="Indicator.PNG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Sep 2013 13:10:02 GMT</pubDate>
    <dc:creator>Bruce123</dc:creator>
    <dc:date>2013-09-26T13:10:02Z</dc:date>
    <item>
      <title>Characterizing rows with colurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94556#M290157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I wish to write a code that evaluates the value of&amp;nbsp; three variables.&lt;/P&gt;&lt;P&gt;I want to do thus that if each of the three variable's value is negaitv, than &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; valuescolurs turn red ( this is to be done when I am doing a proc report if possible).&lt;/P&gt;&lt;P&gt;If two of the variable's value are negativ and one is positive, then all the values turn yellow.&lt;/P&gt;&lt;P&gt;If two of the varible's value are positiv and one is negative, then all the values turn blue&lt;/P&gt;&lt;P&gt;And if all the variable's value are positive, then they all turn green. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if you look at the attached file I would want all the &lt;SPAN style="text-decoration: underline;"&gt;values&lt;/SPAN&gt; in that row to turn blue ( you can just ignore the variable performance 2010, so there is only 3 variables).&lt;/P&gt;&lt;P&gt;Is this possible? &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11224i61B4F31DF6BF54F7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Indicator.PNG" title="Indicator.PNG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 13:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94556#M290157</guid>
      <dc:creator>Bruce123</dc:creator>
      <dc:date>2013-09-26T13:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Characterizing rows with colurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94557#M290158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks like an interesting programming problem,&lt;/P&gt;&lt;P&gt;but I don't have time to deal with it now.&lt;/P&gt;&lt;P&gt;What I CAN do is mention that&lt;/P&gt;&lt;P&gt;the inability to distinguish red and green is commonest form of color blindness,&lt;/P&gt;&lt;P&gt;and you might wish to take that into account in your color-coding rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To me, this looks like a two-step process.&lt;/P&gt;&lt;P&gt;One pass to determine the color for each row.&lt;/P&gt;&lt;P&gt;Then a report-writer step of some sort to color part of the row content based on row number.&lt;/P&gt;&lt;P&gt;Yes, I'm stating the obvious, and you need the code.&lt;/P&gt;&lt;P&gt;I will be interested in seeing the solution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Good Luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 16:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94557#M290158</guid>
      <dc:creator>LeRoyBessler</dc:creator>
      <dc:date>2013-09-26T16:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Characterizing rows with colurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94558#M290159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, a few days after the original question above from Bruce123, I got involved in responding to a series of color-coding questions by another SAS user (Harry) in postings at the SAS Analytics and BI LinkedIn group. To see that dialogue, if interested, go to&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&amp;amp;discussionID=277345018&amp;amp;gid=130238&amp;amp;commentID=167395902&amp;amp;trk=view_disc&amp;amp;fromEmail=&amp;amp;ut=1HO7sBtlf0aBY1" title="http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&amp;amp;discussionID=277345018&amp;amp;gid=130238&amp;amp;commentID=167395902&amp;amp;trk=view_disc&amp;amp;fromEmail=&amp;amp;ut=1HO7sBtlf0aBY1"&gt;http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&amp;amp;discussionID=277345018&amp;amp;gid=130238&amp;amp;commentID=167395902&amp;amp;trk=view_disc&amp;amp;fromEmail=&amp;amp;ut=1HO7sBtlf0aBY1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One of Harry's questions there was analogous to the question from Bruce123 here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That answer to both questions, from Bruce123 and Harry, is in the second example in SAS Note &lt;A href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fsupport%2Esas%2Ecom%2Fkb%2F23%2F353%2Ehtml&amp;amp;urlhash=CV3t&amp;amp;_t=tracking_disc" rel="nofollow" target="blank"&gt;http://support.sas.com/kb/23/353.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 00:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94558#M290159</guid>
      <dc:creator>LeRoyBessler</dc:creator>
      <dc:date>2013-10-04T00:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Characterizing rows with colurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94559#M290160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length colour $6 ;&lt;/P&gt;&lt;P&gt;set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var1 &amp;lt; 0 then varind1 = -1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else varind1 = 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var2 &amp;lt; 0 then varind2 = -1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else varind1 = 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var3 &amp;lt; 0 then varind3 = -1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else varind1 = 1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varscore = sum(varind1,varind2,varind3) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if varscore = -3 then colour = 'Red' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if varscore = -1 then colour = 'Yellow' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if varscore = 1 then colour = 'Blue' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else colour = 'Green' ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the colours in a format to traffic light the proc report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94559#M290160</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2013-10-04T01:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Characterizing rows with colurs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94560#M290161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thank you for the link. It seems to be what I was looking for.&lt;/P&gt;&lt;P&gt;However, I have encountered a new problem, and I am hoping it is possible for some help.&lt;/P&gt;&lt;P&gt;As I see it you can only use the "compute" function on one variable at a time. As I see it, I have to use a "compute" function on 3 variables, but I am not sure if this is possible. I could do a "compute" three times separtely, but that I beleive will be ineffiecent, since if do one for each add a colour to at row then they will overwrite eachother, and I cannot add the colour on columns because I need it to be on the row. &lt;/P&gt;&lt;P&gt;I am looking for, if possible, to compute to three variables at once. Below you can see my code to see what I am trying to say.&amp;nbsp; You should just look at the "compute-part" of the code. The rest of the code is fine. I can see that the compute-part is wrong, but my idea is to in that kind of way, if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC REPORT DATA = Have HEADLINE NOWINDOWS SPLIT='*' Contents='' /* Removes node entirely */ spanrows /* én stor celle pr. gruppe værdi */&lt;/P&gt;&lt;P&gt;%ReportStyles &lt;/P&gt;&lt;P&gt;STYLE(column) = [background=white cellwidth=75pt]&lt;/P&gt;&lt;P&gt;STYLE(report)= [font_size=0.5 font_face=Times]; /* Makro med report indstillinger */&lt;/P&gt;&lt;P&gt;TITLE FONT=Times HEIGHT=4 Color=Black&amp;nbsp; "Performance for de 3 seneste år (pct. og mio. kr.) på forvaltere pr. %SYSFUNC(putn(&amp;amp;ReportDate,DDMMYY10.))";&lt;/P&gt;&lt;P&gt;FOOTNOTE FONT=Times HEIGHT=4 Color=Black 'Performance målt ift. forvalter benchmark.';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE mv &amp;gt;= 0.5 AND ParentNodeName in ('Aktier', 'Obligationer', 'Ejendomme');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLUMNS OBS ParentNodeName ModelPortfolioName Performance_2010 Performance_2011 Performance_2012 Performance_2013;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE OBS / GROUP NOPRINT;&lt;/P&gt;&lt;P&gt;DEFINE ParentNodeName / 'Type' GROUP;&lt;/P&gt;&lt;P&gt;DEFINE ModelPortfolioName / 'Forvalter' GROUP STYLE(column) = [cellwidth=/*150pt*/130pt] ORDER=DATA;;&lt;/P&gt;&lt;P&gt;DEFINE Performance_2010 / 'Performance 2010'&amp;nbsp; FORMAT=COMMAX20.1 STYLE(column) = [cellwidth=/*50pt*/40pt] style(column) = {font_weight=Bold foreground=cback.};&lt;/P&gt;&lt;P&gt;DEFINE Performance_2011 / 'Performance 2011'&amp;nbsp; FORMAT=COMMAX20.1 STYLE(column) = [cellwidth=/*50pt*/40pt] style(column) = {font_weight=Bold foreground=cback.};&lt;/P&gt;&lt;P&gt;DEFINE Performance_2012 / ' Performance 2012' FORMAT=COMMAX20.1 STYLE(column) = [cellwidth=/*50pt*/40pt] style(column) = {font_weight=Bold foreground=cback.};&lt;/P&gt;&lt;P&gt;DEFINE Performance_2013 / 'Performance ÅTD'&amp;nbsp;&amp;nbsp; FORMAT=COMMAX20.1 STYLE(column) = [cellwidth=/*50pt*/40pt] style(column) = {font_weight=Bold foreground=cback.};&lt;/P&gt;&lt;P&gt;BREAK AFTER ParentNodeName / PAGE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compute Performance_2013; Performance_2012; Performance_2011;&lt;/P&gt;&lt;P&gt;if performance_2013 &amp;lt;=0 and Performance_2011 &amp;lt;=0 and Performance_2012 &amp;lt;=0 Then Call Define (_row_,"style","style={background=blue}");&lt;/P&gt;&lt;P&gt;Else if&amp;nbsp; performance_2013 &amp;gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0 and Performance_2011 &amp;lt;0 and Performance_2012 &amp;lt;=0 Then Call Define (_row_,"style","style={background=yellow}");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Endcomp;&lt;/P&gt;&lt;P&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2013 15:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Characterizing-rows-with-colurs/m-p/94560#M290161</guid>
      <dc:creator>Bruce123</dc:creator>
      <dc:date>2013-10-07T15:17:34Z</dc:date>
    </item>
  </channel>
</rss>

