<?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 how to create a new sheet only on byval1 in proc report using ods excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-new-sheet-only-on-byval1-in-proc-report-using/m-p/877119#M346509</link>
    <description>&lt;P&gt;The following code extract creates for each cod_mrc and _fec_unic combination a worksheet.&lt;/P&gt;
&lt;P&gt;But I want to add a sheet only triggered by the first by group, here cod_mrc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A workaround is to eliminate the second by group from the by statement and use it in the where clause (repeating the proc report block 5 times) so that I get 5 months of 2023 stacked in one sheet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But is there an easy way?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close;
ods excel file='/caslibs/marketing/compared3.xlsx';
ods excel options( sheet_name='Brand: #byval1'); 

options missing=0;
proc report data=ONAIR.SUM_HIERARCHY2(rename=('_Ventas Retail VN'n=fin '_Uds Retail VN'n=ren 'Ventas Retail VN'n=myfin 'Uds Retail VN'n=myren )) spanrows 
nowd center out=three completerows;
by cod_mrc _fec_unic ;
where year(_fec_unic) = 2023 and _fec_unic le '30apr2023'd ;
format _fec_unic monyy.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 May 2023 16:54:34 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2023-05-23T16:54:34Z</dc:date>
    <item>
      <title>how to create a new sheet only on byval1 in proc report using ods excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-new-sheet-only-on-byval1-in-proc-report-using/m-p/877119#M346509</link>
      <description>&lt;P&gt;The following code extract creates for each cod_mrc and _fec_unic combination a worksheet.&lt;/P&gt;
&lt;P&gt;But I want to add a sheet only triggered by the first by group, here cod_mrc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A workaround is to eliminate the second by group from the by statement and use it in the where clause (repeating the proc report block 5 times) so that I get 5 months of 2023 stacked in one sheet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But is there an easy way?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close;
ods excel file='/caslibs/marketing/compared3.xlsx';
ods excel options( sheet_name='Brand: #byval1'); 

options missing=0;
proc report data=ONAIR.SUM_HIERARCHY2(rename=('_Ventas Retail VN'n=fin '_Uds Retail VN'n=ren 'Ventas Retail VN'n=myfin 'Uds Retail VN'n=myren )) spanrows 
nowd center out=three completerows;
by cod_mrc _fec_unic ;
where year(_fec_unic) = 2023 and _fec_unic le '30apr2023'd ;
format _fec_unic monyy.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2023 16:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-new-sheet-only-on-byval1-in-proc-report-using/m-p/877119#M346509</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-05-23T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a new sheet only on byval1 in proc report using ods excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-new-sheet-only-on-byval1-in-proc-report-using/m-p/877124#M346512</link>
      <description>&lt;P&gt;I am not sure I follow what you are asking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why not just remove the second variable from the BY statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the sheet to change use the SHEET_INTERVAL option of ODS EXCEL.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 17:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-a-new-sheet-only-on-byval1-in-proc-report-using/m-p/877124#M346512</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-23T17:03:51Z</dc:date>
    </item>
  </channel>
</rss>

