<?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: Getting a total using proc tabulate but with a condition in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853242#M37538</link>
    <description>&lt;P&gt;We don't have those data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need (a portion of) your data as working SAS data step code. Example in this thread (scroll down):&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Calculate-a-rolling-moving-sum/m-p/852135#M336854" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Calculate-a-rolling-moving-sum/m-p/852135#M336854&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see this link for more examples and a macro that can provide data properly.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2023 12:50:09 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-01-11T12:50:09Z</dc:date>
    <item>
      <title>Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853210#M37530</link>
      <description>&lt;P&gt;I was using proc tabulate, although it gave me the desired output but&lt;/P&gt;&lt;P&gt;- Firstly, the output ss below has some useless columns like _type_ , _page_, _table_ , which I don't want.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673422546934.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79261iA1F0985F78BDCD95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673422546934.png" alt="Kirito1_0-1673422546934.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;-Secondly, I want only 9th 10th and 11th January data only like the output I am getting as below ss with the total of frequency from 1JAN2023 to today.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_1-1673422862610.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79262i50EEEF59210A95FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_1-1673422862610.png" alt="Kirito1_1-1673422862610.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the below ss I only want 9JAN 10JAN and TOTAL(from 1JAN2023 till today).&lt;/P&gt;&lt;P&gt;So my question is How to remove 1JAN till 8JAN and still get the same total.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MicrosoftTeams-image.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79266i014EDA67B58F9422/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MicrosoftTeams-image.png" alt="MicrosoftTeams-image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could anyone help?&lt;/P&gt;&lt;P&gt;Ur contribution is appreciated. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 09:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853210#M37530</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T09:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853222#M37533</link>
      <description>Please, someone help!!</description>
      <pubDate>Wed, 11 Jan 2023 11:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853222#M37533</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T11:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853223#M37534</link>
      <description>&lt;P&gt;Please provide data as working SAS data step code, which has been requested of you several times previously. We're trying to help you, but you have to help us.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 11:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853223#M37534</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-11T11:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853235#M37536</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;data final2_1t;
set FINAL_DATE_DATA1t(keep=FIN_EMP_CODE  VPA Status Emp_Code DATE_OF_APPROVAL);  
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code is the data step which I am tabulating using proc tabulate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 12:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853235#M37536</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T12:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853237#M37537</link>
      <description>see if this could help</description>
      <pubDate>Wed, 11 Jan 2023 12:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853237#M37537</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T12:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853242#M37538</link>
      <description>&lt;P&gt;We don't have those data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need (a portion of) your data as working SAS data step code. Example in this thread (scroll down):&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Calculate-a-rolling-moving-sum/m-p/852135#M336854" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Calculate-a-rolling-moving-sum/m-p/852135#M336854&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see this link for more examples and a macro that can provide data properly.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 12:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853242#M37538</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-11T12:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a total using proc tabulate but with a condition</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853278#M37539</link>
      <description>&lt;P&gt;If you are going to use Proc Tabulate to create data sets you&amp;nbsp; will have to work within the confines of what the out= option provides. As mentioned in another of your posts you can use the data set option Drop to remove variables. However the variable you mention, such as _type_ and _table_ are used to indicate which total something may represent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you request &lt;STRONG&gt;might&lt;/STRONG&gt; be possible with a custom multilabel format, might. Your output does not show any values of 01JAN2023 so it may not be possible to get a "total of frequency from 1JAN2023 to today. "&lt;/P&gt;
&lt;P&gt;REALLY need input data example and the exact output expected.&lt;/P&gt;
&lt;P&gt;An example with multilabel format.&lt;/P&gt;
&lt;PRE&gt;data example;
   do date= '01Jan2023'd to today();
   /* create different numbers of records for each date*/
      do i=1 to rand('integer',10);
         output;
      end;
   end;
   format date date9.;
run;

proc format;
value dategrp (multilabel notsorted)
'01Jan2023'd - '11Jan2023'd='1 to 11 Jan'
'09Jan2023'd               ='09Jan2023'
'10Jan2023'd               ='10Jan2023'
;
run;

proc tabulate data=example;
   class date /mlf order=data;
   format date dategrp.;
   table date,
         n
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Multilabel formats are only available in a very few procedures, Tabulate, Report, Means and Summary.&lt;/P&gt;
&lt;P&gt;The order of definition and options in the Proc format code coupled with the options in Proc Tabulate may make getting a specific order of output a bit challenging.&lt;/P&gt;
&lt;P&gt;You cannot use the function Today() in a simple range assignment for a Value range in Proc format. If you want such flexibility you may be able to use your source data to make a CNTLIN data set that would make a similar format definition. Again, might.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 04:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Getting-a-total-using-proc-tabulate-but-with-a-condition/m-p/853278#M37539</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-12T04:05:23Z</dc:date>
    </item>
  </channel>
</rss>

