<?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: Finding No of Days between two dates in SAS VA in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153712#M627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi BIC_USER...that was extremely useful. I just got my o/p. perhaps wanted to know, the range days always gives the same no of days when I change with other product dimensions or customer dimensions? any suggestions would help.&lt;/P&gt;&lt;P&gt;greetings&lt;/P&gt;&lt;P&gt;satlr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Aug 2014 10:18:55 GMT</pubDate>
    <dc:creator>sat_lr</dc:creator>
    <dc:date>2014-08-05T10:18:55Z</dc:date>
    <item>
      <title>Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153702#M617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I find the number of days between two given dates in SAS VA using existing dates in the table?&amp;nbsp;&amp;nbsp; say for ex find no of days between 12 April, 2014 - 23 June, 2014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use any of the following functionalities to achieve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. New Custom Category&lt;/P&gt;&lt;P&gt;2. New Calculated Item&lt;/P&gt;&lt;P&gt;3. New Aggregated Measure &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls you could also suggest any other ways to achieve it. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good day!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 07:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153702#M617</guid>
      <dc:creator>sat_lr</dc:creator>
      <dc:date>2014-06-24T07:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153703#M618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sat_Ir...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While using VA 6.3 I found that creating a calculated field subtracting the dates form each other, getting the days as difference, does not work.&lt;/P&gt;&lt;P&gt;I found the following solution after creating a new calculated item&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Diff_dates.png" class="jive-image-thumbnail jive-image" height="78" src="https://communities.sas.com/legacyfs/online/6706_Diff_dates.png" width="984" /&gt;&lt;/P&gt;&lt;P&gt;Sure it will work for you as well, because this is all about payment days.&lt;/P&gt;&lt;P&gt;Maybe someone else has a better idea....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&amp;nbsp; Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 07:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153703#M618</guid>
      <dc:creator>PeterWijers</dc:creator>
      <dc:date>2014-06-26T07:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153704#M619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks wejers. can you pls describe this expression. I see 'day of year' and I think this was made out of VA option day of week or something. 'paymdate' must be the invoice date here. and there is 'date' as well in the expression. little explanation will help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;satlr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 06:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153704#M619</guid>
      <dc:creator>sat_lr</dc:creator>
      <dc:date>2014-07-07T06:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153705#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi satir,&lt;/P&gt;&lt;P&gt;to get de difference between 2 dates you realy need this longer expression. (all done in sas va)&lt;/P&gt;&lt;P&gt;so create a new calculated item with the same formula set-up.&lt;/P&gt;&lt;P&gt;Just replace the "date" and&amp;nbsp; "Paym.date" with the dates you want to compare.&amp;nbsp; (those are dates I use in my script)&lt;/P&gt;&lt;P&gt;I found that while only using dayofyear command, you can not check the days difference over a year switch.&lt;/P&gt;&lt;P&gt;So while checking the year change between the dates multiplied with 365 and adding the days difference, you get it right.&lt;/P&gt;&lt;P&gt;greetings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153705#M620</guid>
      <dc:creator>PeterWijers</dc:creator>
      <dc:date>2014-07-16T12:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153706#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wejers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply. That was extremely helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 11:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153706#M621</guid>
      <dc:creator>sat_lr</dc:creator>
      <dc:date>2014-07-18T11:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153707#M622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this is a shot in the dark, but have you tried using the DATDIF() function? It's my understanding that you can use SAS functions in VA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 16:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153707#M622</guid>
      <dc:creator>cov_derek</dc:creator>
      <dc:date>2014-07-24T16:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153708#M623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a calculated item and then &lt;SPAN style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"&gt;Use function TreatAs to convert dates into numbers and subtract them.&amp;nbsp; If they are in DateTime then don't forget to use DatePart.&amp;nbsp; If you want to do Today - StartDate then you could use TreatAs DatePart ( Now() ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"&gt;If you want to do EndDate - StartDate OR Today - StartDate (if EndDate is missing), you could do that too using the Boolean Operator first.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="treatas.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6878_treatas.jpg" width="450" /&gt;&lt;IMG alt="treatas2.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6879_treatas2.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 16:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153708#M623</guid>
      <dc:creator>jimd_sas</dc:creator>
      <dc:date>2014-07-24T16:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153709#M624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A bit of a tangent to the original question, but I think it is valuable to share. I see all the responses showing how to create expressions to address the original question - but they are being shared as screenshots. Did you know you can also share them in their Text version - which not only you can modify directly, as if you were authoring code or SQL, but also copy and past between VA instances?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example. I have been working on the expression below, which is similar to the ones above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="6965" alt="query_visual.png" class="jive-image-thumbnail jive-image jiveImage" src="https://communities.sas.com/legacyfs/online/6965_query_visual.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I will switch to its Text version. Just click on the tab at the top right of the editing area:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="6966" alt="query_text.png" class="jive-image-thumbnail jive-image jiveImage" src="https://communities.sas.com/legacyfs/online/6966_query_text.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Next, right-click on it, select all and copy to the clipboard:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="6967" alt="query_copy.png" class="jive-image-thumbnail jive-image jiveImage" src="https://communities.sas.com/legacyfs/online/6967_query_copy.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;And here is the final result, as text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;( 'Open+'n NotIn ('CLOSED') ) AND ( ( Year(DatePart(Now())) - Year('Date Opened'n) ) &amp;lt;= 'YearHorizon'p )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your dataset has matching columns, you can re-create my expression simply by going into a new expression editor and pasting the text above in the Text editing area. Or you can paste it and change variable names to match your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I even keep a file with my favorite expressions that I re-use in different reports and explorations.&lt;/P&gt;&lt;P&gt;Give it a try!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 19:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153709#M624</guid>
      <dc:creator>Nascif_SAS</dc:creator>
      <dc:date>2014-08-01T19:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153710#M625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a related&amp;nbsp; sample that you might be interested in. It uses the TreatAs function to capture the number of days between two dates selected on a range slider&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/52/706.html" title="http://support.sas.com/kb/52/706.html"&gt;52706 - Capturing the number of days on a range slider in SAS® Visual Analytics Designer&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 14:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153710#M625</guid>
      <dc:creator>Madelyn_SAS</dc:creator>
      <dc:date>2014-08-04T14:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153711#M626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks nasif...that was pretty good approach. will give a try! greetings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;satlr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 09:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153711#M626</guid>
      <dc:creator>sat_lr</dc:creator>
      <dc:date>2014-08-05T09:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153712#M627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi BIC_USER...that was extremely useful. I just got my o/p. perhaps wanted to know, the range days always gives the same no of days when I change with other product dimensions or customer dimensions? any suggestions would help.&lt;/P&gt;&lt;P&gt;greetings&lt;/P&gt;&lt;P&gt;satlr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 10:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/153712#M627</guid>
      <dc:creator>sat_lr</dc:creator>
      <dc:date>2014-08-05T10:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/294844#M5202</link>
      <description>&lt;P&gt;I would like to share another work around to solve the issue which is quite affective:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem statement: Creating buckets on difference of two dates in SAS VA&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming two date columns&lt;/P&gt;&lt;P&gt;1. Date(1)&lt;/P&gt;&lt;P&gt;2. Now 2 (1) (Current Date)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steps to follow :&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Under "Property &amp;gt; Format " section of &lt;SPAN&gt;Date(1)&lt;/SPAN&gt; and &lt;SPAN&gt;Now 2 (1)&lt;/SPAN&gt; select format to be " Day of Year"&lt;/P&gt;&lt;P&gt;2.Create calculated column&amp;nbsp;"&lt;STRONG&gt;Difference in Date&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4755i4D7235D57E49B77C/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Calculate Item" title="Calculate Item" /&gt;&lt;/P&gt;&lt;P&gt;3. Again convert format of "Difference in Date" to "Day of year"&lt;/P&gt;&lt;P&gt;4. Create Buckets using Custom category options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 14:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/294844#M5202</guid>
      <dc:creator>sam11</dc:creator>
      <dc:date>2016-08-29T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Finding No of Days between two dates in SAS VA</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/308393#M5722</link>
      <description>&lt;P&gt;I'm finding that this method does not account for days difference greater than 365, e.g., June 1, 2014 to May 31, 2016.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m-p/308393#M5722</guid>
      <dc:creator>HowardNewstadt</dc:creator>
      <dc:date>2016-10-31T22:20:57Z</dc:date>
    </item>
  </channel>
</rss>

