<?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: Create a graph in SAS from a data set with 3 variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801408#M33216</link>
    <description>&lt;P&gt;Strongly agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; that moving to SGPLOT is the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gchart would require&amp;nbsp; a Group=variablename and likely a GAXIS statement for "groups" to display. And possibly a Subgroup=variable&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 18:00:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-10T18:00:22Z</dc:date>
    <item>
      <title>Create a graph in SAS from a data set with 3 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801393#M33214</link>
      <description>&lt;P&gt;Hello everyone, I am trying to get a graph in a pdf in SAS from a table with 3 columns, the first ("fecha") has the type date: 10MAR22, 09MAR22, etc. the second column ("Rango_horas") has two values, "OFF-WORK" and "WORK", so each date value will be duplicated, 10MAR22 will have "OFF-WORK" and "WORK", and the last column (" AVG") has the average % of cpu used, i.e. a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to make a bar graph showing the different dates and the value that AVG has for OFF-WORK and WORK for each of the dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS pdf file = '/xx/xx/xx/Namepdf.pdf';
Axis1
	STYLE=1
	WIDTH=1
	MINOR=NONE
	LABEL=(   "%CPU")
	ORDER=(0 TO 100 BY 10)

;
Axis2
	STYLE=1
	WIDTH=1
	LABEL=(   "Fecha")
  VALUE=NONE
;
TITLE;
TITLE1 "TEST";
FOOTNOTE;



PROC GCHART DATA=WORK.QUERY_FOR_TEST1
;
	VBAR 
	 fecha
 /
	CLIPREF
		SPACE=15
FRAME	TYPE=SUM
	COUTLINE=BLACK
	RAXIS=AXIS1
	MAXIS=AXIS2
	LREF=4
	CREF=LTGRAY
	AUTOREF
;
/* -------------------------------------------------------------------
   End of task code
   ------------------------------------------------------------------- */
RUN; QUIT;
TITLE; FOOTNOTE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run this it adds the avg values of offwork and work, it does not distinguish the "Rango_horas" column and it creates a column for each date, I would like to see 2 columns for each date value. Would this be possible?&lt;/P&gt;
&lt;P&gt;Thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801393#M33214</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-10T16:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a graph in SAS from a data set with 3 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801396#M33215</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot dta=have;
vbar date / response=avg group=rango_horas groupdisplay=cluster;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Highly recommend SGPLOT instead of GCHART/GPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I think you're looking for the clustered bar chart (first image)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://robslink.com/SAS/ods2/aaaindex.htm" target="_blank"&gt;https://robslink.com/SAS/ods2/aaaindex.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone, I am trying to get a graph in a pdf in SAS from a table with 3 columns, the first ("fecha") has the type date: 10MAR22, 09MAR22, etc. the second column ("Rango_horas") has two values, "OFF-WORK" and "WORK", so each date value will be duplicated, 10MAR22 will have "OFF-WORK" and "WORK", and the last column (" AVG") has the average % of cpu used, i.e. a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to make a bar graph showing the different dates and the value that AVG has for OFF-WORK and WORK for each of the dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS pdf file = '/xx/xx/xx/Namepdf.pdf';
Axis1
	STYLE=1
	WIDTH=1
	MINOR=NONE
	LABEL=(   "%CPU")
	ORDER=(0 TO 100 BY 10)

;
Axis2
	STYLE=1
	WIDTH=1
	LABEL=(   "Fecha")
  VALUE=NONE
;
TITLE;
TITLE1 "TEST";
FOOTNOTE;



PROC GCHART DATA=WORK.QUERY_FOR_TEST1
;
	VBAR 
	 fecha
 /
	CLIPREF
		SPACE=15
FRAME	TYPE=SUM
	COUTLINE=BLACK
	RAXIS=AXIS1
	MAXIS=AXIS2
	LREF=4
	CREF=LTGRAY
	AUTOREF
;
/* -------------------------------------------------------------------
   End of task code
   ------------------------------------------------------------------- */
RUN; QUIT;
TITLE; FOOTNOTE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run this it adds the avg values of offwork and work, it does not distinguish the "Rango_horas" column and it creates a column for each date, I would like to see 2 columns for each date value. Would this be possible?&lt;/P&gt;
&lt;P&gt;Thank you very much in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 17:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801396#M33215</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-10T17:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a graph in SAS from a data set with 3 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801408#M33216</link>
      <description>&lt;P&gt;Strongly agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; that moving to SGPLOT is the way to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gchart would require&amp;nbsp; a Group=variablename and likely a GAXIS statement for "groups" to display. And possibly a Subgroup=variable&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 18:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-graph-in-SAS-from-a-data-set-with-3-variables/m-p/801408#M33216</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-10T18:00:22Z</dc:date>
    </item>
  </channel>
</rss>

