<?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 SAS Visual Analytics Report Control - Work Weeks Ago (WWAgo) in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Report-Control-Work-Weeks-Ago-WWAgo/m-p/600715#M13258</link>
    <description>&lt;P&gt;&lt;U&gt;Greetings Fellow Community Members,&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To borrow from a popular radio show.. 'Long time reader, First time poster'.&amp;nbsp; While critiques are welcome, i will ask every to please be kind.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use of Visual Analytics has grown leaps and bounds for my company over the past few years.&amp;nbsp; Among the many highlights of SASVA, users really value having data sets updated on a regular frequency to get the most recent understanding of business processes.&amp;nbsp; For the longest time, many report owners have used the notion of DaysAgo to default reports to only showing the current or previous day (&lt;EM&gt;extending to some number of days ago&lt;/EM&gt;) without having to constantly update and save SAS Visual Analytics Reports.&amp;nbsp; Just set a control on the object to always filter 0, 1, 2, n days ago and every time the report opens that number of days will be displayed.&amp;nbsp; This is especially handy if you use the Report Email option to send PDF snapshots to users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some internal co-workers have been after me for a long time to develop a similar solution for Work Weeks Ago (WWAgo).&amp;nbsp; &lt;U&gt;NOTE:&amp;nbsp; I am aware that i could do this calculation at the time of ETL into LASR/CAS, however there are cases where I find this to not be the most effective path such as if the ETL is only processed a few times a week.&lt;/U&gt;&amp;nbsp; Anyhow, this capability would allow them to default various objects within a report to always show current and/or previous (or any number of work weeks) workweek to understand business challenges and use that data to drive resources where they can provide the greatest benefit.&amp;nbsp; After some morning contemplation time and loads of coffee, inspiration hit me rather hard this morning as to how to effectively do a calculated item in VA to achieve this WWAgo value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First two quick comments:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;My company defines WW’s as (this makes using the on-board Visual Analytics WW function not entirely helpful)&lt;OL&gt;&lt;LI&gt;First day of week:&amp;nbsp; Monday&lt;/LI&gt;&lt;LI&gt;First week of year:&amp;nbsp; First 4 day week&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Quick Reminder:&amp;nbsp; SAS Stores Date and DateTime differently.&lt;OL&gt;&lt;LI&gt;Date is the integer number of days since January 1st, 1960 (EG Oct 30 2019 = 21852)&lt;/LI&gt;&lt;LI&gt;DateTime is the integer number of seconds since January 1st, 1960 (EG Oct 30 2019 = 1888012800)&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With item #2 above in mind, you will need to know how you data is stored in SAS and then choose a solution path below to add a new calculated item below.&amp;nbsp; Note the Date/DateTime column is denoted with a gold star and you can copy and paste the text version into a New Calculated Item dialog box and simply substitute your Date or DateTime field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;If your Date is a Date data type&lt;/STRONG&gt;:&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Date.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33513i8C34E84EE4C965D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date.jpg" alt="Date.jpg" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Text Version:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;Floor(( ( TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 )) - Floor(( ( TreatAs(_Number_, 'Date'n) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 ))&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If your Date is a DateTime data type&lt;/STRONG&gt;:&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DateTime.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33514i344882A6BD587966/image-size/large?v=v2&amp;amp;px=999" role="button" title="DateTime.jpg" alt="DateTime.jpg" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;Text Version:&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;Floor(( ( TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 )) - Floor(( ( TreatAs(_Number_, DatePart('Date'n)) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 ))&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In the calculation above, I choose Jan 1st 2018 as a base date as it was a Monday.&amp;nbsp; I suspect the rest of the logic ought to make sense after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this in a report will allow you to set a filter such as this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WW Control.jpg" style="width: 212px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33509i99D600FF2A720C80/image-size/large?v=v2&amp;amp;px=999" role="button" title="WW Control.jpg" alt="WW Control.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To default to the current week like this (note that the earliest date here is Monday October 28th):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 430px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33512iC4BCB52ABE78B450/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading.&amp;nbsp; I hope this is sufficient information for you to replicate this technique against your data sets and that it inspires you to modify or create new value streams for your data / analytics within your business.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, i would like feedback so leave comments below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 14:49:00 GMT</pubDate>
    <dc:creator>utrocketeng</dc:creator>
    <dc:date>2019-10-31T14:49:00Z</dc:date>
    <item>
      <title>SAS Visual Analytics Report Control - Work Weeks Ago (WWAgo)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Report-Control-Work-Weeks-Ago-WWAgo/m-p/600715#M13258</link>
      <description>&lt;P&gt;&lt;U&gt;Greetings Fellow Community Members,&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To borrow from a popular radio show.. 'Long time reader, First time poster'.&amp;nbsp; While critiques are welcome, i will ask every to please be kind.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use of Visual Analytics has grown leaps and bounds for my company over the past few years.&amp;nbsp; Among the many highlights of SASVA, users really value having data sets updated on a regular frequency to get the most recent understanding of business processes.&amp;nbsp; For the longest time, many report owners have used the notion of DaysAgo to default reports to only showing the current or previous day (&lt;EM&gt;extending to some number of days ago&lt;/EM&gt;) without having to constantly update and save SAS Visual Analytics Reports.&amp;nbsp; Just set a control on the object to always filter 0, 1, 2, n days ago and every time the report opens that number of days will be displayed.&amp;nbsp; This is especially handy if you use the Report Email option to send PDF snapshots to users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some internal co-workers have been after me for a long time to develop a similar solution for Work Weeks Ago (WWAgo).&amp;nbsp; &lt;U&gt;NOTE:&amp;nbsp; I am aware that i could do this calculation at the time of ETL into LASR/CAS, however there are cases where I find this to not be the most effective path such as if the ETL is only processed a few times a week.&lt;/U&gt;&amp;nbsp; Anyhow, this capability would allow them to default various objects within a report to always show current and/or previous (or any number of work weeks) workweek to understand business challenges and use that data to drive resources where they can provide the greatest benefit.&amp;nbsp; After some morning contemplation time and loads of coffee, inspiration hit me rather hard this morning as to how to effectively do a calculated item in VA to achieve this WWAgo value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First two quick comments:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;My company defines WW’s as (this makes using the on-board Visual Analytics WW function not entirely helpful)&lt;OL&gt;&lt;LI&gt;First day of week:&amp;nbsp; Monday&lt;/LI&gt;&lt;LI&gt;First week of year:&amp;nbsp; First 4 day week&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Quick Reminder:&amp;nbsp; SAS Stores Date and DateTime differently.&lt;OL&gt;&lt;LI&gt;Date is the integer number of days since January 1st, 1960 (EG Oct 30 2019 = 21852)&lt;/LI&gt;&lt;LI&gt;DateTime is the integer number of seconds since January 1st, 1960 (EG Oct 30 2019 = 1888012800)&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With item #2 above in mind, you will need to know how you data is stored in SAS and then choose a solution path below to add a new calculated item below.&amp;nbsp; Note the Date/DateTime column is denoted with a gold star and you can copy and paste the text version into a New Calculated Item dialog box and simply substitute your Date or DateTime field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;If your Date is a Date data type&lt;/STRONG&gt;:&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Date.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33513i8C34E84EE4C965D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date.jpg" alt="Date.jpg" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Text Version:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;Floor(( ( TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 )) - Floor(( ( TreatAs(_Number_, 'Date'n) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 ))&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If your Date is a DateTime data type&lt;/STRONG&gt;:&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DateTime.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33514i344882A6BD587966/image-size/large?v=v2&amp;amp;px=999" role="button" title="DateTime.jpg" alt="DateTime.jpg" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;Text Version:&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;Floor(( ( TreatAs(_Number_, DatePart(Now())) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 )) - Floor(( ( TreatAs(_Number_, DatePart('Date'n)) - TreatAs(_Number_, DateFromMDY(1, 1, 2018)) ) / 7 ))&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In the calculation above, I choose Jan 1st 2018 as a base date as it was a Monday.&amp;nbsp; I suspect the rest of the logic ought to make sense after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this in a report will allow you to set a filter such as this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WW Control.jpg" style="width: 212px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33509i99D600FF2A720C80/image-size/large?v=v2&amp;amp;px=999" role="button" title="WW Control.jpg" alt="WW Control.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To default to the current week like this (note that the earliest date here is Monday October 28th):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 430px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33512iC4BCB52ABE78B450/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading.&amp;nbsp; I hope this is sufficient information for you to replicate this technique against your data sets and that it inspires you to modify or create new value streams for your data / analytics within your business.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, i would like feedback so leave comments below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Report-Control-Work-Weeks-Ago-WWAgo/m-p/600715#M13258</guid>
      <dc:creator>utrocketeng</dc:creator>
      <dc:date>2019-10-31T14:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Visual Analytics Report Control - Work Weeks Ago (WWAgo)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Report-Control-Work-Weeks-Ago-WWAgo/m-p/600901#M13259</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;Nice solution to a common problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I normally have added the time dimension (year, quarter,mopnth,week) before loading data to VA and then use the rank function to get the. n last periods, but this is useful if you only have the date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like it a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 09:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-Visual-Analytics-Report-Control-Work-Weeks-Ago-WWAgo/m-p/600901#M13259</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2019-11-01T09:09:44Z</dc:date>
    </item>
  </channel>
</rss>

