<?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: Using parallelPeriod for calculations with date filter in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271181#M4242</link>
    <description>Hi Bruno,&lt;BR /&gt;Above method u suggested create only one bar for given month and not two bars for different year seperately as needed. +&lt;BR /&gt;I want to select both starttime and endtime which is not possible here.&lt;BR /&gt;Plz suggest alternatives as I'm not proficient with t using parameters</description>
    <pubDate>Wed, 18 May 2016 05:53:31 GMT</pubDate>
    <dc:creator>makarand</dc:creator>
    <dc:date>2016-05-18T05:53:31Z</dc:date>
    <item>
      <title>Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270317#M4208</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;my requirement is I want to filter the period&amp;nbsp; (say 01-31 May 2016 / using slider maybe)&lt;/P&gt;&lt;P&gt;and see the sales for this year as well as last year for the same period.&lt;/P&gt;&lt;P&gt;the period could be dates/months/years but I want to see this year value as well as last year value.&lt;/P&gt;&lt;P&gt;I tried parellel period and relative period but both disappears when i put period less than a year.&lt;/P&gt;&lt;P&gt;illustative diagram is attached.&lt;/P&gt;&lt;P&gt;hope this is possible wo changing dataset.&lt;/P&gt;&lt;P&gt;Scenario &amp;gt;&lt;/P&gt;&lt;P&gt;01may2016 to 31 May 2016 &amp;gt;&amp;gt; 01-31 may 2016 and 2015&lt;/P&gt;&lt;P&gt;01jan2015 to 31dec2015 &amp;gt;&amp;gt; 010115 to 31122015 and 01012014 to 31122014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12540i058986A3AB81B2F4/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SampleChart.png" title="SampleChart.png" /&gt;</description>
      <pubDate>Fri, 13 May 2016 11:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270317#M4208</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2016-05-13T11:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270331#M4210</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to create a filter on your report object, the filter can use any parameter value. Please note a parameter can only be numeric or character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So one approach could be:&lt;/P&gt;
&lt;P&gt;Create a new calculated date item like below. This will create a character item in form of 2016M05.&lt;/P&gt;
&lt;PRE&gt;Format('date'n[Raw], 'YYMM7.')&lt;/PRE&gt;
&lt;P&gt;Then put a dropdown list into the canvas area and assign this the calculated item from before to this dropdown list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a parameter of type character and assign it to the dropdown list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then create a filter on you bar chart similar to this:&lt;/P&gt;
&lt;PRE&gt;( Year('date'n) = ( Parse(Substring('dateYYMM_p'p, 1, 4), 'F12.') - 1 ) )
OR
( Year('date'n) = Parse(Substring('dateYYMM_p'p, 1, 4), 'F12.') )&lt;/PRE&gt;
&lt;P&gt;Now whenever to select a given month from the dropdown list, the bar chart will be filtered accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The example only covers filter for the selected year and year - 1, it needs to be adapted to also check for the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You then have data from two years and can use Periodic operators&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 12:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270331#M4210</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-13T12:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270595#M4214</link>
      <description>Thanks Bruno..&lt;BR /&gt;Will check as I want to give range for minimum 10 days diff and max year..&lt;BR /&gt;</description>
      <pubDate>Sun, 15 May 2016 17:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/270595#M4214</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2016-05-15T17:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271181#M4242</link>
      <description>Hi Bruno,&lt;BR /&gt;Above method u suggested create only one bar for given month and not two bars for different year seperately as needed. +&lt;BR /&gt;I want to select both starttime and endtime which is not possible here.&lt;BR /&gt;Plz suggest alternatives as I'm not proficient with t using parameters</description>
      <pubDate>Wed, 18 May 2016 05:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271181#M4242</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2016-05-18T05:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271196#M4243</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to select a date range, then I suggest to use a slider in the section prompt area. Assign the right date variable to the slider, then your report objects are filtered automatically&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See a screenshot below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3213i80E4108382B0E9C7/image-size/original?v=v2&amp;amp;px=-1" alt="Slider for date range" title="Slider for date range" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 06:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271196#M4243</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-18T06:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271226#M4245</link>
      <description>&lt;P&gt;i have created a filter like attached file&amp;nbsp; or text&lt;/P&gt;&lt;P&gt;( ( Year(DatePart('INVOICE_DATE'n)) &amp;gt; ( Parse(Substring('start_date'p, 5, 4), 'F12.') - 1 ) ) AND ( Year(DatePart('INVOICE_DATE'n)) &amp;lt;= ( Parse(Substring('end_date'p, 5, 4), 'F12.') - 1 ) ) ) OR ( ( Year(DatePart('INVOICE_DATE'n)) &amp;gt; Parse(Substring('start_date'p, 5, 4), 'F12.') ) AND ( Year(DatePart('INVOICE_DATE'n)) &amp;lt;= Parse(Substring('end_date'p, 5, 4), 'F12.') ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;but still I am not able to generate the mentioned report.&lt;/P&gt;&lt;P&gt;will appriciate if you correct the code for the ranges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Slider will only accept numeric parameters and not text parameters, hence not able to parameterize to the dates like u suggested it for text parameters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;( ( Year(DatePart('INVOICE_DATE'n)) &amp;gt; ( Parse(Substring('start_date'p, 5, 4), 'F12.') - 1 ) ) AND ( Year(DatePart('INVOICE_DATE'n)) &amp;lt;= ( Parse(Substring('end_date'p, 5, 4), 'F12.') - 1 ) ) ) OR ( ( Year(DatePart('INVOICE_DATE'n)) &amp;gt; Parse(Substring('start_date'p, 5, 4), 'F12.') ) AND ( Year(DatePart('INVOICE_DATE'n)) &amp;lt;= Parse(Substring('end_date'p, 5, 4), 'F12.') ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12546iC5BCE88055AC02FB/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SampleChart-Filter.png" title="SampleChart-Filter.png" /&gt;</description>
      <pubDate>Wed, 18 May 2016 09:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271226#M4245</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2016-05-18T09:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271252#M4246</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not know what the content of the start_date parameter looks like, so difficult to say&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also is invoice_date really a datetime value? If it is just a date, you do not need the datepart operator?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to test the outcome of your expressions, I suggest to create a new data item and then use the preview button to see the outcome of an expression, see also below. This should help with debugging.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3219i5BAADD5397C0036B/image-size/original?v=v2&amp;amp;px=-1" alt="Capture.PNG" title="Capture.PNG" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 09:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271252#M4246</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-18T09:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using parallelPeriod for calculations with date filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271674#M4271</link>
      <description>&lt;P&gt;Thnks Bruno,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created filter which will include date values for this year and last year as u suggested but with the Date9. format and then use datefromMDY to create required range/period.&lt;/P&gt;&lt;P&gt;Thnks again for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 10:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Using-parallelPeriod-for-calculations-with-date-filter/m-p/271674#M4271</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2016-05-19T10:51:20Z</dc:date>
    </item>
  </channel>
</rss>

