<?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 with all column vertically in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877734#M346741</link>
    <description>&lt;P&gt;OK, i understand.&lt;/P&gt;
&lt;P&gt;Thank you .&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 16:30:33 GMT</pubDate>
    <dc:creator>sascode</dc:creator>
    <dc:date>2023-05-26T16:30:33Z</dc:date>
    <item>
      <title>proc tabulate with all column vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877692#M346726</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I a have a dataset as follows:&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input year item $ type $ ;&lt;BR /&gt;datalines;&lt;BR /&gt;2020 a 1 &lt;BR /&gt;2020 a 2&lt;BR /&gt;2020 a 1 &lt;BR /&gt;2021 b 1 &lt;BR /&gt;2021 b 2&lt;BR /&gt;2021 a 3 &lt;BR /&gt;2022 a 1 &lt;BR /&gt;2022 a 2&lt;BR /&gt;2022 a 2 &lt;BR /&gt;2022 b 3;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Using tabulate procedure as follows, I can get desired results but I wanted to "all" total items sold each year vertically , instead of horizontally. So mainly, how to rotate all row for each year from horizontally to vertically?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc tabulate data = have;&lt;BR /&gt;class year item type;&lt;BR /&gt;table year * (item * type all), N='Count type'(pctn&amp;lt; type all&amp;gt; = "Pctn Type" ) /printmiss misstext= '0' ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Here is desired output:&lt;/P&gt;
&lt;TABLE width="455"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="3" width="191.804px" height="57px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="88.875px" height="57px"&gt;Count type&lt;/TD&gt;
&lt;TD width="109.804px" height="57px"&gt;Pctn Type&lt;/TD&gt;
&lt;TD width="63.9464px" height="57px"&gt;All&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;year&lt;/TD&gt;
&lt;TD width="63.9286px" height="30px"&gt;item&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;type&lt;/TD&gt;
&lt;TD rowspan="2" width="88.875px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="2" width="109.804px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;66.67&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="7" width="63.9464px" height="210px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="6" width="63.9375px" height="180px"&gt;2020&lt;/TD&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;a&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;33.33&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;b&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="7" width="63.9375px" height="210px"&gt;2021&lt;/TD&gt;
&lt;TD width="63.9286px" height="30px"&gt;item&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;type&lt;/TD&gt;
&lt;TD rowspan="2" width="88.875px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="2" width="109.804px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="7" width="63.9464px" height="210px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;a&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;b&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="7" width="63.9375px" height="210px"&gt;2022&lt;/TD&gt;
&lt;TD width="63.9286px" height="30px"&gt;item&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;type&lt;/TD&gt;
&lt;TD rowspan="2" width="88.875px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="2" width="109.804px" height="60px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;33.33&lt;/P&gt;
&lt;/TD&gt;
&lt;TD rowspan="7" width="63.9464px" height="210px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;a&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;66.67&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD rowspan="3" width="63.9286px" height="90px"&gt;b&lt;/TD&gt;
&lt;TD width="63.9375px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;2&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;0&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="63.9375px" height="30px"&gt;3&lt;/TD&gt;
&lt;TD width="88.875px" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="109.804px" height="30px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 26 May 2023 13:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877692#M346726</guid>
      <dc:creator>sascode</dc:creator>
      <dc:date>2023-05-26T13:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate with all column vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877725#M346736</link>
      <description>&lt;P&gt;Tabulate isn't going to do a "merged row cells" that way.&lt;/P&gt;
&lt;P&gt;About the only way I can think of that to make one column with merged count would be to summarize the data in a data set and use the data step Report Writing Interface build the cells with the row spanning you request.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 15:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877725#M346736</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-26T15:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate with all column vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877734#M346741</link>
      <description>&lt;P&gt;OK, i understand.&lt;/P&gt;
&lt;P&gt;Thank you .&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 16:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877734#M346741</guid>
      <dc:creator>sascode</dc:creator>
      <dc:date>2023-05-26T16:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate with all column vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877820#M346791</link>
      <description>&lt;P&gt;You could add the information at the bottom of the table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data = have;
class year item type;
keylabel n=' ';
table 
  year * (item * type) year*all,
  N='Count type'(pctn&amp;lt; type all&amp;gt; = "Pctn Type" )
  /printmiss misstext= '0' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1685152693851.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84373iCCD7FF5C9E84B42C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1685152693851.png" alt="Patrick_0-1685152693851.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 01:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/877820#M346791</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-05-27T01:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate with all column vertically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/878295#M346986</link>
      <description>Yes, it is true, however, i would like to have it vertically .&lt;BR /&gt;Thank you for your time.</description>
      <pubDate>Tue, 30 May 2023 19:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-with-all-column-vertically/m-p/878295#M346986</guid>
      <dc:creator>sascode</dc:creator>
      <dc:date>2023-05-30T19:11:08Z</dc:date>
    </item>
  </channel>
</rss>

