<?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: Proc tabulate customized order in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917383#M44346</link>
    <description>&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n12teq2mctxmbjn1hu0ykvqwgpvp.htm" target="_self"&gt;CLASS statement&lt;/A&gt; in PROC TABULATE has a DESCENDING option, did you try that?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 15:44:28 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-02-22T15:44:28Z</dc:date>
    <item>
      <title>Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/916940#M44328</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I have a dataset with two numerical variables and 3 categorical variables. I need to sort the results of my proc tabulate in descending order based on the numeric variable I use as the analysis variable in the proc tabulate. I've tried various ways to pre-sort the dataset but I can't get any results. I'm attaching my code in case you can give me a hand. Thank you so much in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;PROC TABULATE&lt;/DIV&gt;&lt;DIV&gt;DATA=WORK.RESULTADOS_TOTAL_V3&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR porc_de_variacion_PD porc_de_importancia;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CLASS model / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CLASS variable / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CLASS clasificacion / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TABLE&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* PAGE Statement */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;all = 'Total'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clasificacion&amp;nbsp; ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* ROW Statement */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;model *variable&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;all = 'Total'&amp;nbsp; ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* COLUMN Statement */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(porc_de_variacion_PD * Sum={LABEL="Suma"} porc_de_importancia * Sum={LABEL="Suma"} ) ;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;RUN;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 10:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/916940#M44328</guid>
      <dc:creator>Pedrommo</dc:creator>
      <dc:date>2024-02-20T10:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917356#M44344</link>
      <description>Have you seen the thread &lt;A href="https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-order-of-rows/td-p/763131" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-order-of-rows/td-p/763131&lt;/A&gt;?&lt;BR /&gt;I'm not sure if you can apply it in your case. But maybe it provides some insight.</description>
      <pubDate>Thu, 22 Feb 2024 13:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917356#M44344</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2024-02-22T13:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917380#M44345</link>
      <description>&lt;P&gt;You can create a data set using Proc Tabulate that contains the elements of the report plus some layout information.&lt;/P&gt;
&lt;P&gt;Use the OUT=option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be possible to sort that data set in the order of the statistics plus appropriate layout information and display the results though likely NOT using proc tabulate again.&lt;/P&gt;
&lt;P&gt;You will need to look at the _TYPE_ _PAGE_ and _TABLE_ variables that hold the layout information and use them in your sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without data and an example of the expected output for that data it isn't going to be possible to provide working code.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 15:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917380#M44345</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-02-22T15:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917383#M44346</link>
      <description>&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n12teq2mctxmbjn1hu0ykvqwgpvp.htm" target="_self"&gt;CLASS statement&lt;/A&gt; in PROC TABULATE has a DESCENDING option, did you try that?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 15:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917383#M44346</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-22T15:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917391#M44350</link>
      <description>&lt;P&gt;Your code identifies TWO analysis variables, each of whose SUM you want to display in the table.&amp;nbsp; That means it would display two columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, instead of ordering the table rows based on the row classification variable (ascending or descending or formatted), I think you want to order based on descending SUM of an analysis variable.&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"&lt;SPAN&gt;descending order based on the numeric variable I use as the analysis variable in the proc tabulate"&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do I understand correctly?&amp;nbsp; If I don't you can ignore everything below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if so, then I ask:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;which of the two columns do you wish to control the row order?&lt;/LI&gt;
&lt;LI&gt;does this mean you will accept different order of the row classifier for each page dimension?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To do this, I think you will have to do something like&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run PROC SUMMARY to generate the cell contents in an intermediate data set.&lt;/LI&gt;
&lt;LI&gt;Read that data set, an create an additional ad hoc row variable based on the descending SUM of an analysis variable, for each page dimension.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Run a proc report or proc tabulate from the product of step 2.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917391#M44350</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-02-22T16:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917543#M44353</link>
      <description>Hello, the forum you mention uses a categorical variable to sort instead of the analysis variable (numeric). Thanks anyway!</description>
      <pubDate>Fri, 23 Feb 2024 10:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917543#M44353</guid>
      <dc:creator>Pedrommo</dc:creator>
      <dc:date>2024-02-23T10:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917551#M44354</link>
      <description>Yes, I tried that, but I need to order using the VAR statement. Thanks anyway!</description>
      <pubDate>Fri, 23 Feb 2024 10:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917551#M44354</guid>
      <dc:creator>Pedrommo</dc:creator>
      <dc:date>2024-02-23T10:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate customized order</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917552#M44355</link>
      <description>Thank you so much! This is what I was looking for.</description>
      <pubDate>Fri, 23 Feb 2024 10:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Proc-tabulate-customized-order/m-p/917552#M44355</guid>
      <dc:creator>Pedrommo</dc:creator>
      <dc:date>2024-02-23T10:53:11Z</dc:date>
    </item>
  </channel>
</rss>

