<?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: Fill the grid using automation in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625940#M20310</link>
    <description>&lt;P&gt;From the SQL code, it appears Year is already a variable in your data set, but your rows also look to depend on the month as well. If those are both variables in your data set, then you can use PROC REPORT to calculate the sums you want, do any grouping you need, and create columns out of the Years if you include them as an ACROSS variable.&lt;BR /&gt;&lt;BR /&gt;I will say though, that depending on the complexity of the report relative to the data you want - it might be easier to use an analysis PROC like PROC MEANS to get the summaries you want into a data set, then just use PROC REPORT to customize the display for your data.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2020 18:29:20 GMT</pubDate>
    <dc:creator>Duggins</dc:creator>
    <dc:date>2020-02-19T18:29:20Z</dc:date>
    <item>
      <title>Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625917#M20304</link>
      <description>&lt;P&gt;Hi All, I need to fill the below grid by automation, Please advise me the best way to approach:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Grid.PNG" style="width: 594px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36244i17C4A660B0257D14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Grid.PNG" alt="Grid.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625917#M20304</guid>
      <dc:creator>Deva_123</dc:creator>
      <dc:date>2020-02-19T18:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625918#M20305</link>
      <description>&lt;P&gt;PROC REPORT or TABULATE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282034"&gt;@Deva_123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All, I need to fill the below grid by automation, Please advise me the best way to approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Grid.PNG" style="width: 594px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36244i17C4A660B0257D14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Grid.PNG" alt="Grid.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625918#M20305</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-02-19T18:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625920#M20306</link>
      <description>&lt;P&gt;What does the data look like that you are working with and what do you want the final result to look like? That would be helpful for suggesting a solution. For example, if the values of sales are already present along with the full dates, that is different than if you need to create the dates and the sums!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625920#M20306</guid>
      <dc:creator>Duggins</dc:creator>
      <dc:date>2020-02-19T18:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625927#M20307</link>
      <description>&lt;P&gt;Hi dugginsj, My final result should be the grid as shown, my data set has Sales date and Sales Amount. Just I need to sum up by date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create values by below SQL but looking for automation :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE Grid AS&lt;BR /&gt;SELECT&amp;nbsp;&lt;BR /&gt;/* SUM_of_Tot_Sales */&lt;BR /&gt;(SUM(t1.Tot_Sales)) FORMAT=15.2 AS SUM_of_Tot_Sales&lt;BR /&gt;FROM Sales t1&lt;BR /&gt;WHERE t1.YEAR = 2018 AND t1.Sales-Date &amp;lt;= '1Jan2019'd;&lt;BR /&gt;QUIT;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625927#M20307</guid>
      <dc:creator>Deva_123</dc:creator>
      <dc:date>2020-02-19T18:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625940#M20310</link>
      <description>&lt;P&gt;From the SQL code, it appears Year is already a variable in your data set, but your rows also look to depend on the month as well. If those are both variables in your data set, then you can use PROC REPORT to calculate the sums you want, do any grouping you need, and create columns out of the Years if you include them as an ACROSS variable.&lt;BR /&gt;&lt;BR /&gt;I will say though, that depending on the complexity of the report relative to the data you want - it might be easier to use an analysis PROC like PROC MEANS to get the summaries you want into a data set, then just use PROC REPORT to customize the display for your data.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625940#M20310</guid>
      <dc:creator>Duggins</dc:creator>
      <dc:date>2020-02-19T18:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625974#M20311</link>
      <description>&lt;P&gt;My Input data looks like below, I am unable to automate the code. Please help me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer ID&lt;/TD&gt;&lt;TD&gt;Total_Sales&lt;/TD&gt;&lt;TD&gt;YEAR&lt;/TD&gt;&lt;TD&gt;Sales_Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;794.68&lt;/TD&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;13Oct2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;6201.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;07Apr2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2000.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;14Sep2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2000.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;14Oct2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2000.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;15Sep2016&lt;/TD&gt;&lt;/T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&lt;TD&gt;15Apr2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;882.00&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;15Oct2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;750.00&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;19Jul2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;750.00&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;03Mar2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;499288.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;24Aug2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;500.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;18Apr2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;500.00&lt;/TD&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;17Oct2016&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am unable to automate the code :&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.'QUERY_FOR_SAMPLE DATA_0000'n AS&lt;BR /&gt;SELECT /* COUNT_of_Customer ID */&lt;BR /&gt;(COUNT(t1.'Customer ID'n)) AS 'COUNT_of_Customer ID'n,&lt;BR /&gt;/* SUM_of_Total_Sales */&lt;BR /&gt;(SUM(t1.Total_Sales)) FORMAT=F12.2 AS SUM_of_Total_Sales,&lt;BR /&gt;t1.YEAR&lt;BR /&gt;FROM WORK.'QUERY_FOR_SAMPLE DATA'n t1&lt;BR /&gt;WHERE t1.Sales_Date &amp;lt;= '1Jan2017'd AND t1.YEAR = 2016&lt;BR /&gt;GROUP BY t1.YEAR;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 20:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625974#M20311</guid>
      <dc:creator>Deva_123</dc:creator>
      <dc:date>2020-02-19T20:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625990#M20312</link>
      <description>Did you try PROC TABULATE?</description>
      <pubDate>Wed, 19 Feb 2020 20:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/625990#M20312</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-02-19T20:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fill the grid using automation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/626165#M20349</link>
      <description>&lt;P&gt;I would strongly suggest looking for an alternative to SQL. Your table is a bit confusing because the rows show "Y+1" which makes it appear as if they would span multiple years, but your columns indicate the years and your row label makes it appear your sums should be cumulative rather than just a sum within each month*year combination.&lt;BR /&gt;&lt;BR /&gt;If you truly want cumulative sums without necessarily having data for each of the month*year combinations, then you may need to augment your data set to include every month*year combination before computing the sums, otherwise SAS will not include rows/columns where no data appears in the data set.&lt;BR /&gt;&lt;BR /&gt;If this were my client, I would want a more clear understanding of exactly how those values are supposed to appear in the table. Then I would go to the DATA step and build out what I needed to get my sums (for example, I included a DATA step below), then I would go to PROC REPORT and print them. It isn't a single-step solution, but your data does not appear to be in a format that would allow us to provide a single step that gets exactly the output you want.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop = id sales);
  set have;
  by year month date;
  if first.year then total = 0;
  total+sales;
  if last.month then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-the-grid-using-automation/m-p/626165#M20349</guid>
      <dc:creator>Duggins</dc:creator>
      <dc:date>2020-02-20T15:00:27Z</dc:date>
    </item>
  </channel>
</rss>

