<?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: INTNX for identifying New and Existing Customers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202581#M37800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the question is the month boundaries&lt;/P&gt;&lt;P&gt;to select:&lt;/P&gt;&lt;P&gt;where intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; =1&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if only in the previous month*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; le 1&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if in the previous or current month*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flag:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; =1) as new&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;( intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; le 1) as new&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jul 2015 21:34:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-07-14T21:34:56Z</dc:date>
    <item>
      <title>INTNX for identifying New and Existing Customers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202577#M37796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm need to working with SAS date functions any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm trying to set two flags in a data set, one for New Customers and one for Existing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;New Customers = have an original_purchase_date in the previous month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Existing Customers = have an original_purchase_date before previous month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;And I want to pull in all activity for the last 18 months as of the Last day in the previous month where the Last day in the previous month is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;%let end='30Jun15'd;run; &lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;This is what I have so far and I know this code is incorrect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;proc sql; &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;create table Cust as select *, case when original_purchase_date between intnx('MONTH', &amp;amp;end, -1) and intnx('MONTH', &amp;amp;end) then 1 else 0 end as new,&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt; case when original_purchase_date lt intnx('MONTH', &amp;amp;end, -1) then 1 else 0 end as Existing from orders where original_purchase_date between intnx('MONTH', &amp;amp;end, -1) and intnx('MONTH', &amp;amp;end, -1) -18;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt; quit;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, any &lt;SPAN style="font-size: 13.3333330154419px;"&gt;help is appreciated. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 18:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202577#M37796</guid>
      <dc:creator>JFM</dc:creator>
      <dc:date>2015-07-14T18:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX for identifying New and Existing Customers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202578#M37797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you should provide some example data and the desired result.&lt;/P&gt;&lt;P&gt;I am concerned that, if I understand you correctly, if I run this data approach at a latter date a client that was previously Existing becomes New because their initial purchase was near the beginning of the 18 month frame and don't show up in a later frame if there are long intervals between purchases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 19:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202578#M37797</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-14T19:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX for identifying New and Existing Customers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202579#M37798</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;Forget about the 18 months. I'm just looking to identify &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;New Customers = have an original_purchase_date in the previous month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222222; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: inherit; font-size: 10pt; font-style: inherit; font-weight: inherit; line-height: 1.5em;"&gt;Existing Customers = have an original_purchase_date before previous month&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Based on a month end date of &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13.3333320617676px; background-color: #ffffff;"&gt;%let end='30Jun15'd&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 20:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202579#M37798</guid>
      <dc:creator>JFM</dc:creator>
      <dc:date>2015-07-14T20:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX for identifying New and Existing Customers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202580#M37799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your terminology is confusing. Previous month is actually the&lt;STRONG&gt; last month in your data set&lt;/STRONG&gt;, is that correct? So if some one's first purchase is in the last month they're new and if later then existing?&lt;/P&gt;&lt;P&gt;Also, start with the basics, are you sure you're pulling 18 months of data correctly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 21:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202580#M37799</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-14T21:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX for identifying New and Existing Customers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202581#M37800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the question is the month boundaries&lt;/P&gt;&lt;P&gt;to select:&lt;/P&gt;&lt;P&gt;where intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; =1&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if only in the previous month*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; le 1&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if in the previous or current month*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flag:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; =1) as new&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;( intnx('month',original_purchase_date, &amp;amp;end)&amp;nbsp; le 1) as new&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 21:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-for-identifying-New-and-Existing-Customers/m-p/202581#M37800</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-14T21:34:56Z</dc:date>
    </item>
  </channel>
</rss>

