<?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 Charts in SAS and also create data set with percent informats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728035#M226533</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have summary data for each date with following information:&lt;/P&gt;
&lt;P&gt;Total money paid by govername to people who applied for getting help(money).&lt;/P&gt;
&lt;P&gt;Tota costs (The total amount that governemt spent on these payments)&lt;/P&gt;
&lt;P&gt;PCT_Good (percent of people that recieved money)&lt;/P&gt;
&lt;P&gt;PCT_bad (percent of people that didnt recieve money)&lt;/P&gt;
&lt;P&gt;4 reasons for bad:&amp;nbsp;PCT_Reason1,PCT_Reason2,PCT_Reason3,PCT_Reason4.&lt;/P&gt;
&lt;P&gt;Please note that the limit money that can be paid in each date is 200 Million dollars.&lt;/P&gt;
&lt;P&gt;I want to create the following charts in SAS:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;chart1(Time series line chart with 2 lines and 1 Horizontal&amp;nbsp; line) &lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;line1: Total_paid VS Date&lt;/P&gt;
&lt;P&gt;line2: Total_costs VS Date&lt;/P&gt;
&lt;P&gt;line3:Horizontal line on value 200&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;chart2(Time series bar chart with multiple bars)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;For each date there will be a bar that will be devided into 5 parts:&lt;/P&gt;
&lt;P&gt;PCT_Good (green color)&lt;/P&gt;
&lt;P&gt;PCT_Reason1(Red color)&lt;/P&gt;
&lt;P&gt;PCT_Reason2(pink color)&lt;/P&gt;
&lt;P&gt;PCT_Reason3(blue color)&lt;/P&gt;
&lt;P&gt;PCT_Reason4(grey color)&lt;/P&gt;
&lt;P&gt;By looking at this chart we can understand proprtion of people (percentage) who recieved gelp and&amp;nbsp;proprtion of people who didnt recieve help and the reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see the raw data.&lt;/P&gt;
&lt;P&gt;I also have a problem to create the summary data set with percent informats.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data SummaryData;
Input Date :ddmmyy10.	Total_paid	Total_Costs	PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4;
cards;
01/03/2021 170 180 60% 20% 10% 5%	5%
02/03/2021 180 185 65% 15% 15% 5%	 0%
03/03/2021 182 190 70% 10% 5%	10%	5%
04/03/2021 161 170 80% 5%	2.50% 2.50%	10%
05/03/2021 185 198 70% 10% 10% 10% 0%
;
run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Mar 2021 21:50:04 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-03-21T21:50:04Z</dc:date>
    <item>
      <title>Charts in SAS and also create data set with percent informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728035#M226533</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have summary data for each date with following information:&lt;/P&gt;
&lt;P&gt;Total money paid by govername to people who applied for getting help(money).&lt;/P&gt;
&lt;P&gt;Tota costs (The total amount that governemt spent on these payments)&lt;/P&gt;
&lt;P&gt;PCT_Good (percent of people that recieved money)&lt;/P&gt;
&lt;P&gt;PCT_bad (percent of people that didnt recieve money)&lt;/P&gt;
&lt;P&gt;4 reasons for bad:&amp;nbsp;PCT_Reason1,PCT_Reason2,PCT_Reason3,PCT_Reason4.&lt;/P&gt;
&lt;P&gt;Please note that the limit money that can be paid in each date is 200 Million dollars.&lt;/P&gt;
&lt;P&gt;I want to create the following charts in SAS:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;chart1(Time series line chart with 2 lines and 1 Horizontal&amp;nbsp; line) &lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;line1: Total_paid VS Date&lt;/P&gt;
&lt;P&gt;line2: Total_costs VS Date&lt;/P&gt;
&lt;P&gt;line3:Horizontal line on value 200&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;chart2(Time series bar chart with multiple bars)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;For each date there will be a bar that will be devided into 5 parts:&lt;/P&gt;
&lt;P&gt;PCT_Good (green color)&lt;/P&gt;
&lt;P&gt;PCT_Reason1(Red color)&lt;/P&gt;
&lt;P&gt;PCT_Reason2(pink color)&lt;/P&gt;
&lt;P&gt;PCT_Reason3(blue color)&lt;/P&gt;
&lt;P&gt;PCT_Reason4(grey color)&lt;/P&gt;
&lt;P&gt;By looking at this chart we can understand proprtion of people (percentage) who recieved gelp and&amp;nbsp;proprtion of people who didnt recieve help and the reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see the raw data.&lt;/P&gt;
&lt;P&gt;I also have a problem to create the summary data set with percent informats.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data SummaryData;
Input Date :ddmmyy10.	Total_paid	Total_Costs	PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4;
cards;
01/03/2021 170 180 60% 20% 10% 5%	5%
02/03/2021 180 185 65% 15% 15% 5%	 0%
03/03/2021 182 190 70% 10% 5%	10%	5%
04/03/2021 161 170 80% 5%	2.50% 2.50%	10%
05/03/2021 185 198 70% 10% 10% 10% 0%
;
run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 21:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728035#M226533</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-03-21T21:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Charts in SAS and also create data set with percent informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728042#M226539</link>
      <description>&lt;P&gt;I haven't tested this, but something like this will work for #1, if that's not it exactly, it is close and you ought to be able to modify it as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=summarydata; 
    series x=date y=total_paid;
    series x=date y=total_costs;
    refline 200/axis=y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't really know what a "Time series bar chart" is. Can you show us an example?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 22:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728042#M226539</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-21T22:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Charts in SAS and also create data set with percent informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728045#M226541</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Please see the raw data.&lt;/P&gt;
&lt;P&gt;I also have a problem to create the summary data set with percent informats.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Since "Informats" are used to &lt;STRONG&gt;read&lt;/STRONG&gt; external data there would be very little need or use in creating an "informat" for summarized data which implies the data was already in SAS and you did something to summarize that data. A format is one thing.&lt;/P&gt;
&lt;P&gt;But without showing how you summarize the raw data, as in example data, code to summarize and expected output it hard to provide examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And for your posted example did you try the PERCENT informat?&lt;/P&gt;
&lt;PRE&gt;Data SummaryData;
 informat Date ddmmyy10.	Total_paid	Total_Costs best8.	
     PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4 percent.;
 Input Date Total_paid	Total_Costs	PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4;
 format  PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4 percent8.1;
cards;
01/03/2021 170 180 60% 20% 10% 5%	5%
02/03/2021 180 185 65% 15% 15% 5%	 0%
03/03/2021 182 190 70% 10% 5%	10%	5%
04/03/2021 161 170 80% 5%	2.50% 2.50%	10%
05/03/2021 185 198 70% 10% 10% 10% 0%
;
run;&lt;/PRE&gt;
&lt;P&gt;Remember if you want to a nice display format that you need to provide a FORMAT . The Percent format uses () to designate negative values so you need to provide a few more positions than you expect to display the values properly.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 23:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728045#M226541</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-21T23:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Charts in SAS and also create data set with percent informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728050#M226544</link>
      <description>&lt;A href="https://www.vizwiz.com/2012/08/displaying-time-series-data-stacked.html" target="_blank"&gt;https://www.vizwiz.com/2012/08/displaying-time-series-data-stacked.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Please see first chart here.&lt;BR /&gt;It is an example to time series bar chart.&lt;BR /&gt;Each bar should be in same height ( that represents 100% of people) and then each bar should be devided into 5 groups by different colours: goods, reason1,reason2,&lt;BR /&gt;reason3,reason4</description>
      <pubDate>Mon, 22 Mar 2021 03:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728050#M226544</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-03-22T03:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Charts in SAS and also create data set with percent informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728111#M226565</link>
      <description>&lt;P&gt;This is called a stacked bar chart in SAS. You would have to transpose the data first to get it into the proper form for PROC SGPLOT. Also, I didn't code up all of your reasons because I'm lazy, but you can fix this to handle all of the reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data SummaryData;
 informat Date ddmmyy10.	Total_paid	Total_Costs best8.	
     PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4 percent.;
 Input Date Total_paid	Total_Costs	PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4;
 format  PCT_Good	PCT_Reason1	PCT_Reason2	PCT_Reason3	PCT_Reason4 percent8.1;
cards;
01/03/2021 170 180 60% 20% 10% 5%	5%
02/03/2021 180 185 65% 15% 15% 5%	 0%
03/03/2021 182 190 70% 10% 5%	10%	5%
04/03/2021 161 170 80% 5%	2.50% 2.50%	10%
05/03/2021 185 198 70% 10% 10% 10% 0%
;
run;
data transposed;
    set summarydata;
    length type $ 10;
    type='Good'; value=pct_good; output;
    type='Reason 1'; value=pct_reason1; output;
    type='Reason 2'; value=pct_reason2; output;
    keep date type value;
run;

proc sgplot data=transposed;
    vbar date/group=type response=value groupdisplay=stack;
    format date ddmmyy.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 11:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Charts-in-SAS-and-also-create-data-set-with-percent-informats/m-p/728111#M226565</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-22T11:41:16Z</dc:date>
    </item>
  </channel>
</rss>

