<?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: Assigning a zero to blank entries rather than removing the date of the missing entry in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421211#M27107</link>
    <description>&lt;P&gt;Your best bet is to create a data set that has all dates&amp;nbsp;in a particular range, including the Sundays as well.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data alldates;
   do TransactionDate='01Jan2014'd to '06Jan2014'd;
       output;
   end;   
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then join it with your aggregated data , setting volumes=0 for the missing Sundays.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table footfall3 as
   select b.TransactionDate format=date9., coalesce(a.volumes,0) as volumes
   from footfall2 as a right join alldates as b
   on a.TransactionDate=b.TransactionDate;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2017 15:42:43 GMT</pubDate>
    <dc:creator>antonbcristina</dc:creator>
    <dc:date>2017-12-14T15:42:43Z</dc:date>
    <item>
      <title>Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421184#M27102</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to count the number of visits to a branch a bank&amp;nbsp;receives per day, which are open from Monday-Saturday. I've attached an excel spreadsheet with my exported results, which shows a number of visits per day from Monday-Saturday.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what I'd like to achieve is rather than a missing volume and date each Sunday, I'd like to output a volume of zero and the particular date each week.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simple&amp;nbsp;code I used to produce the output is as follows:&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Work.Footfall2 as&lt;BR /&gt;select&lt;BR /&gt;Volumes,&lt;BR /&gt;TransactionDate&lt;BR /&gt;from&lt;BR /&gt;Work.Footfall&lt;BR /&gt;group by&lt;BR /&gt;TransactionDate&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas/suggestions would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421184#M27102</guid>
      <dc:creator>joshkylepearce</dc:creator>
      <dc:date>2017-12-14T14:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421186#M27103</link>
      <description>&lt;P&gt;Sorry not going to be downloading Excel files.&amp;nbsp; Also, use the code window - its the {I} above post area - for code.&amp;nbsp; Not sure what your SQL is trying to achieve, you have a group by with no aggregate functions (like sum() or count()).&amp;nbsp; You can use a case when anyways, maybe:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table Work.Footfall2 as
  select case when sum(VOLUMES)=. then 0 else sum(VOLUMES) end as VOLUMES,
         TRANSACTION_DATE
  from   WORK.FOOTFALL
  group by TRANSACTIONS_DATE;
quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421186#M27103</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-14T14:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421191#M27104</link>
      <description>&lt;P&gt;I attempted a case when but unfortunately experienced the same issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421191#M27104</guid>
      <dc:creator>joshkylepearce</dc:creator>
      <dc:date>2017-12-14T14:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421193#M27105</link>
      <description>&lt;P&gt;So post some test data in the form of a datastep, so we can run something.&amp;nbsp; I can't debug something I can't see&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421193#M27105</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-14T14:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421199#M27106</link>
      <description>&lt;P&gt;If your dates are actually SAS date values then you could exclude Sundays from the result with a where clause like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;where weekday(transactiondate) ne 1&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also not going to download Excel files.&lt;/P&gt;
&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 15:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421199#M27106</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-14T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a zero to blank entries rather than removing the date of the missing entry</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421211#M27107</link>
      <description>&lt;P&gt;Your best bet is to create a data set that has all dates&amp;nbsp;in a particular range, including the Sundays as well.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data alldates;
   do TransactionDate='01Jan2014'd to '06Jan2014'd;
       output;
   end;   
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then join it with your aggregated data , setting volumes=0 for the missing Sundays.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table footfall3 as
   select b.TransactionDate format=date9., coalesce(a.volumes,0) as volumes
   from footfall2 as a right join alldates as b
   on a.TransactionDate=b.TransactionDate;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 15:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Assigning-a-zero-to-blank-entries-rather-than-removing-the-date/m-p/421211#M27107</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2017-12-14T15:42:43Z</dc:date>
    </item>
  </channel>
</rss>

