<?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: Order three different types of graphs by by-group in output in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786156#M22431</link>
    <description>&lt;P&gt;I remember&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; answer this question before by PROC DOCUMENTATION .&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 12:37:22 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-12-15T12:37:22Z</dc:date>
    <item>
      <title>Order three different types of graphs by by-group in output</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786155#M22430</link>
      <description>&lt;P&gt;I have created three different graphs with proc sgplot that each use the same by-group: a series plot, a histogram, and a heat map.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to have the output put the series plot, histogram and heat map for group 1 on page 1, then the&amp;nbsp;series plot, histogram and heat map for group 2 on page 2, etc?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I only know how to plot all of the series plots, then all of the histograms, and so on, when using by groups (rather than typing out a plot statement for each group individually).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786155#M22430</guid>
      <dc:creator>kz_</dc:creator>
      <dc:date>2021-12-15T12:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Order three different types of graphs by by-group in output</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786156#M22431</link>
      <description>&lt;P&gt;I remember&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; answer this question before by PROC DOCUMENTATION .&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786156#M22431</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-15T12:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Order three different types of graphs by by-group in output</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786171#M22435</link>
      <description>&lt;P&gt;KSharp is correct: You can use PROC DOCUMENT to replay the graphs in a different order, as shown in the article &lt;A href="https://blogs.sas.com/content/iml/2017/03/06/reorder-output-group-analysis-sas.html" target="_self"&gt;"Reorder the output from a BY-group analysis in SAS."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 13:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786171#M22435</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-15T13:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Order three different types of graphs by by-group in output</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786182#M22436</link>
      <description>&lt;P&gt;One way to accomplish what you're wanting is to loop through the values and call a macro, rather than using the built-in 'by' statement. Here is a minimal example demonstrating how to do it that way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data my_data; set sashelp.electric;
run;

%macro do_graphs(cust);

data tempdata; set my_data (where=(customer="&amp;amp;cust"));
run;

title "&amp;amp;cust";

proc sgplot data=tempdata;
series x=year y=revenue;
run;

proc sgplot data=tempdata;
histogram revenue;
run;

proc sgplot data=tempdata;
heatmap x=year y=revenue;
run;

%mend;

proc sql; create table loopdata as select unique customer from my_data; quit; run;
data _null_; set loopdata;
 call execute('%do_graphs('|| customer ||');'); 
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Order-three-different-types-of-graphs-by-by-group-in-output/m-p/786182#M22436</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-12-15T14:44:51Z</dc:date>
    </item>
  </channel>
</rss>

