<?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 before and after sales in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/before-and-after-sales/m-p/460715#M10130</link>
    <description>&lt;P&gt;I am having a hard time finding a solution to this question, therefore I need your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that has a record for each invoice #.&amp;nbsp; Each record will also have other fields such as cust# sales posted date, sales, etc. etc.&amp;nbsp; I have joined this table to my customer table that has a date that denotes when this customer became a loyalty customer.&amp;nbsp; So now my output table, for each record, has a posted date and the loyalty date.&amp;nbsp; I'm trying to determine the sales for each customer prior to and after the loyalty date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried derived items (maybe i'm not using the correct one) and i've also tried various formats for formulas, such as&lt;/P&gt;&lt;P&gt;If (loyalty date &amp;gt;= posted date), 1 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This lumped every customer as a 1 or a 0, but did not separate them out at the invoice level.&amp;nbsp; Maybe i need to do something to the dates in the calculated item, i'm not sure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;</description>
    <pubDate>Tue, 08 May 2018 14:46:23 GMT</pubDate>
    <dc:creator>Josh_Breault</dc:creator>
    <dc:date>2018-05-08T14:46:23Z</dc:date>
    <item>
      <title>before and after sales</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/before-and-after-sales/m-p/460715#M10130</link>
      <description>&lt;P&gt;I am having a hard time finding a solution to this question, therefore I need your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that has a record for each invoice #.&amp;nbsp; Each record will also have other fields such as cust# sales posted date, sales, etc. etc.&amp;nbsp; I have joined this table to my customer table that has a date that denotes when this customer became a loyalty customer.&amp;nbsp; So now my output table, for each record, has a posted date and the loyalty date.&amp;nbsp; I'm trying to determine the sales for each customer prior to and after the loyalty date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried derived items (maybe i'm not using the correct one) and i've also tried various formats for formulas, such as&lt;/P&gt;&lt;P&gt;If (loyalty date &amp;gt;= posted date), 1 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This lumped every customer as a 1 or a 0, but did not separate them out at the invoice level.&amp;nbsp; Maybe i need to do something to the dates in the calculated item, i'm not sure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 14:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/before-and-after-sales/m-p/460715#M10130</guid>
      <dc:creator>Josh_Breault</dc:creator>
      <dc:date>2018-05-08T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: before and after sales</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/before-and-after-sales/m-p/460932#M10139</link>
      <description>&lt;P&gt;Maybe you can create two new calculated variables for sales (i call it salesVar here) like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sales_after:&lt;/P&gt;
&lt;P&gt;if&amp;nbsp;&lt;SPAN&gt;loyalty date &amp;gt;= posted date then salesVar else 0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sales before:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;if missing(&lt;SPAN&gt;loyalty date) then salesVar else 0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;//Fredrik&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 07:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/before-and-after-sales/m-p/460932#M10139</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-05-09T07:54:34Z</dc:date>
    </item>
  </channel>
</rss>

