<?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 sgplot vbar generating weekly/daily in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401003#M13693</link>
    <description>&lt;P&gt;I'm using the following code to begin. I'd like to divide the x variable OCCUR_DATE into monthly,/weekly/daily var charts for each vehicle.&amp;nbsp;The macro will plot data counts for each individual vehicle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro rept_plot_Cycle(num);
	title "&amp;amp;num Cycle plot";
	proc sgplot data=cycle_data;
		where VEHICLE_NO = "&amp;amp;num" 
		;
		yaxis label= "cycle count";
		vbar x=OCCUR_DATE y=count(fault_code);
	run;
%mend rept_plot_Cycle;

data _null_;
	array veh_no[39] _temporary_ (3725:3763)
;
	call execute('proc sql;');
	do i=1 to dim(veh_no) while (veh_no(i) ne .);
		call execute(cats('%nrstr(%rept_plot_Cycle)(',veh_no(i),')'));
	end;
	call execute('quit;');
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Oct 2017 14:49:58 GMT</pubDate>
    <dc:creator>capam</dc:creator>
    <dc:date>2017-10-04T14:49:58Z</dc:date>
    <item>
      <title>sgplot vbar generating weekly/daily</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401003#M13693</link>
      <description>&lt;P&gt;I'm using the following code to begin. I'd like to divide the x variable OCCUR_DATE into monthly,/weekly/daily var charts for each vehicle.&amp;nbsp;The macro will plot data counts for each individual vehicle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro rept_plot_Cycle(num);
	title "&amp;amp;num Cycle plot";
	proc sgplot data=cycle_data;
		where VEHICLE_NO = "&amp;amp;num" 
		;
		yaxis label= "cycle count";
		vbar x=OCCUR_DATE y=count(fault_code);
	run;
%mend rept_plot_Cycle;

data _null_;
	array veh_no[39] _temporary_ (3725:3763)
;
	call execute('proc sql;');
	do i=1 to dim(veh_no) while (veh_no(i) ne .);
		call execute(cats('%nrstr(%rept_plot_Cycle)(',veh_no(i),')'));
	end;
	call execute('quit;');
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2017 14:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401003#M13693</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-04T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar generating weekly/daily</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401011#M13694</link>
      <description>&lt;P&gt;Can you show us your data or part of it?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401011#M13694</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-04T15:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar generating weekly/daily</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401013#M13695</link>
      <description>&lt;P&gt;Also, the VBAR statement does not support the X= and Y= statements as the SERIES statement does.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out this introduction to the VBAR statement in PROC SGPLOT here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/11/27/getting-started-sgplot-part-2-vbar/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2016/11/27/getting-started-sgplot-part-2-vbar/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401013#M13695</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-04T15:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar generating weekly/daily</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401017#M13696</link>
      <description>&lt;P&gt;Does your data currently have a date variable that contains a SAS date value?&lt;/P&gt;
&lt;P&gt;If so then using a different format such as MONYY, WEEKU or DATE9. would provide different groups for the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you get the desired output for a singe graph with the rept_plot_cycle macro? Your syntax for VBAR is incorrect.&lt;/P&gt;
&lt;P&gt;I think you are intending&lt;/P&gt;
&lt;P&gt;vbar occur_date / group=fault_code stat=freq;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that from what your are doing that By vehicle_no may be a better approach with #byval in the title.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/401017#M13696</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-04T15:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot vbar generating weekly/daily</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/402695#M13782</link>
      <description>&lt;P&gt;I used the following code to solve most of the issue. It is a brute force approach but functional.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	set have;
	by vehicle_no;

	if first.VEHICLE_NO then
		cusum=0;
	cusum+1;
run;

proc sgplot data=have;
	where VEHICLE_NO = "&amp;amp;num"
	;
	yaxis label= "cumulative Incidents";
	scatter x=OCCUR_DATE y=cusum;
run;

data have;
	set have(drop=cusum);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-vbar-generating-weekly-daily/m-p/402695#M13782</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-10T11:58:07Z</dc:date>
    </item>
  </channel>
</rss>

