<?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: Evaluate a percentage of value - for report as bardiagram(Excel) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509780#M137093</link>
    <description>&lt;P&gt;Do you want the data or the graph directly? Both are pretty simple in SAS &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Nov 2018 08:15:11 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-11-02T08:15:11Z</dc:date>
    <item>
      <title>Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509774#M137091</link>
      <description>&lt;P&gt;Hi Community&lt;/P&gt;&lt;P&gt;Here I have a sample data set - the column which contain some values.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input val1 val2;
cards;
6.3 7.2 
6.6 8.1
6.8 6
7 12
7.5 5
8 7.8
9.1 8
1.3 2
12.1 7
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to report the data as the below image.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bar Diagram" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24587iAE447AB949E7D561/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bar Dig.jpg" alt="Bar Diagram" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Bar Diagram&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Orange bar - Val1 , Blue&lt;SPAN&gt;&amp;nbsp;bar - Val2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(Condition 1) &amp;lt;7&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(Condition 2) 7 to 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(Condition 3) &amp;gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;While calculate the Val1's in bar it should like - 8.9 + 24.7 + 66.4 = 100&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While calculate the Val2's in bar it should like - 23.4 + 41.1 + 35.5 = 100&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Val1&lt;/TD&gt;&lt;TD&gt;Val2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;7&lt;/TD&gt;&lt;TD&gt;8.9&lt;/TD&gt;&lt;TD&gt;23.4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7 to 8&lt;/TD&gt;&lt;TD&gt;24.7&lt;/TD&gt;&lt;TD&gt;41.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;gt;8&lt;/TD&gt;&lt;TD&gt;66.4&lt;/TD&gt;&lt;TD&gt;35.5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Please suggest me to solve it.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 06:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509774#M137091</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-11-02T06:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509780#M137093</link>
      <description>&lt;P&gt;Do you want the data or the graph directly? Both are pretty simple in SAS &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 08:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509780#M137093</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-02T08:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509789#M137100</link>
      <description>&lt;P&gt;Also, is your data representative of your example? How does the value&amp;nbsp;&lt;SPAN&gt;66.4 occur for instance?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 08:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509789#M137100</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-02T08:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509807#M137107</link>
      <description>&lt;P&gt;Dear Buddy&lt;/P&gt;&lt;P&gt;I need as a data. I could convert it&amp;nbsp;to diagram.&lt;/P&gt;&lt;P&gt;The above information is just a sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 10:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509807#M137107</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-11-02T10:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509931#M137163</link>
      <description>&lt;P&gt;Ok. So the posted example data should &lt;STRONG&gt;not&lt;/STRONG&gt;&amp;nbsp;result in the posted desired result, correct?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 15:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/509931#M137163</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-02T15:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate a percentage of value - for report as bardiagram(Excel)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/510091#M137240</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215282"&gt;@Sathish_jammy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear Buddy&lt;/P&gt;
&lt;P&gt;I need as a data. I could convert it&amp;nbsp;to diagram.&lt;/P&gt;
&lt;P&gt;The above information is just a sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Large economy sized hint for future posts: You show a "calculation" but the numbers posted should be possible to be made using your example data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there is essentially no way to verify how you get 8.9 24.7 or 66.4 I am guessing that the following might work.&lt;/P&gt;
&lt;P&gt;BTW it is very hard to use a single variable to both group data and generate a sum.&lt;/P&gt;
&lt;PRE&gt;data have;
   input val1 val2;
   length grp $ 10;
   grp='Baseline';value=val1; vgrp=val1;output;
   grp='Follow Up';value=val2; vgrp=val2;output;
   drop val1 val2;
cards;
6.3  7.2 
6.6  8.1
6.8  6
7    12
7.5  5
8    7.8
9.1  8
1.3  2
12.1 7
;
run;
proc format library=work;
value val
low -&amp;lt;7 = '&amp;lt;7'
7  -  8 = '7-8'
8 &amp;lt;- high='&amp;gt;8'
;

proc tabulate data=have out=want;
   class grp vgrp;
   format vgrp val.;
   var value;
   table vgrp='' *value='',
         grp=' '*(sum colpctsum)
         / row=float
   ;
run;


&lt;/PRE&gt;
&lt;P&gt;I reshape the data adding explicit grouping variables for you baseline/followup and the value used to group. Then the format can be applied to one for grouping purposes of the value and other summed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Tabulate will do column percent which I think is what you intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And a basic plot:&lt;/P&gt;
&lt;PRE&gt;Proc sgplot data=want;
   vbar  vgrp / response=value_PctSum_10_value group=grp
                groupdisplay=cluster  datalabel= value_PctSum_10_value
   ;
   label vgrp='Percent group';&lt;BR /&gt;   label grp='Time frame';&lt;BR /&gt;   keylegend /location=inside position=topleft;
   yaxis display=(nolabel);
run;


&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Nov 2018 22:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-a-percentage-of-value-for-report-as-bardiagram-Excel/m-p/510091#M137240</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-02T22:07:55Z</dc:date>
    </item>
  </channel>
</rss>

