<?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: week calculation is SAS VA in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331082#M6323</link>
    <description>&lt;P&gt;Hi Rita,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you may also try to use the function Datepart() which extracts the date information from a date/time number:&lt;/P&gt;&lt;P&gt;WeekNumber(Datepart(DATE_day))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I understood the TreatAs function just converts a number (like 1) to a date/time information (01.01.1960 00:00:00) and the function weeknumber needs a date only information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your DATE_day is a number than you have to convert it first to a date/time (with treatas) and then extract the date part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I'm wrong!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tobias&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2017 07:49:25 GMT</pubDate>
    <dc:creator>TobiasH</dc:creator>
    <dc:date>2017-02-09T07:49:25Z</dc:date>
    <item>
      <title>week calculation is SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331047#M6321</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone let me know why this calculated field is not producing an output.&lt;/P&gt;&lt;P&gt;DATE_day is formated as date/time and that is why I am using TreatAs, otherwise VA doesn't accept the function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WeekNumber(TreatAs(_Date_, 'DATE_day'n))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 01:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331047#M6321</guid>
      <dc:creator>rmalcata</dc:creator>
      <dc:date>2017-02-09T01:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: week calculation is SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331082#M6323</link>
      <description>&lt;P&gt;Hi Rita,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you may also try to use the function Datepart() which extracts the date information from a date/time number:&lt;/P&gt;&lt;P&gt;WeekNumber(Datepart(DATE_day))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I understood the TreatAs function just converts a number (like 1) to a date/time information (01.01.1960 00:00:00) and the function weeknumber needs a date only information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your DATE_day is a number than you have to convert it first to a date/time (with treatas) and then extract the date part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I'm wrong!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tobias&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 07:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331082#M6323</guid>
      <dc:creator>TobiasH</dc:creator>
      <dc:date>2017-02-09T07:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: week calculation is SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331302#M6329</link>
      <description>&lt;P&gt;Hi Tobias,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;The calculation produced something but not really what I expected.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7148iE2445D71D30F40B8/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="week calculation error.PNG" title="week calculation error.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was the formula that I used as you described:&lt;/P&gt;&lt;P&gt;WeekNumber(DatePart('DAY_DATE'n))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything that I am doing wrong?! I am using a calculated field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 19:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/331302#M6329</guid>
      <dc:creator>rmalcata</dc:creator>
      <dc:date>2017-02-09T19:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: week calculation is SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/332445#M6348</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The calcualtion was correct. I just forgot to change the aggregation to min, avg or max. the sum doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 01:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/week-calculation-is-SAS-VA/m-p/332445#M6348</guid>
      <dc:creator>rmalcata</dc:creator>
      <dc:date>2017-02-14T01:06:34Z</dc:date>
    </item>
  </channel>
</rss>

