<?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 Creating a Calculated Item for getting the last response call status in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/612989#M1358</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good day!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seeking for help here for those who have a knowledge in creating calculated items in SAS CI Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the scenario is, i want to get the last response call status of the client using the calculated items.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this table, response_history that stores all the responses of clients in different channel (TLS, SMS). But the thing is, i only need to get the last response call status in terms of TLS channel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a columns like this,&lt;/P&gt;&lt;P&gt;CLIENT_ID | CHANNEL | RESPONSE | DATE&amp;nbsp;&lt;/P&gt;&lt;P&gt;111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TLS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALLED&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/2019&lt;/P&gt;&lt;P&gt;222&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SMS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/2019&lt;/P&gt;&lt;P&gt;111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SMS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/2/2019&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So expectation is, i can get the first row instead of row 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope the description and info are enough, tho you can ask me for more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Otep&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2019 11:23:06 GMT</pubDate>
    <dc:creator>otepalborida</dc:creator>
    <dc:date>2019-12-19T11:23:06Z</dc:date>
    <item>
      <title>Creating a Calculated Item for getting the last response call status</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/612989#M1358</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good day!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seeking for help here for those who have a knowledge in creating calculated items in SAS CI Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the scenario is, i want to get the last response call status of the client using the calculated items.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this table, response_history that stores all the responses of clients in different channel (TLS, SMS). But the thing is, i only need to get the last response call status in terms of TLS channel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a columns like this,&lt;/P&gt;&lt;P&gt;CLIENT_ID | CHANNEL | RESPONSE | DATE&amp;nbsp;&lt;/P&gt;&lt;P&gt;111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TLS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALLED&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/2019&lt;/P&gt;&lt;P&gt;222&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SMS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/2019&lt;/P&gt;&lt;P&gt;111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SMS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/2/2019&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So expectation is, i can get the first row instead of row 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope the description and info are enough, tho you can ask me for more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Otep&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 11:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/612989#M1358</guid>
      <dc:creator>otepalborida</dc:creator>
      <dc:date>2019-12-19T11:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Item for getting the last response call status</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613100#M1359</link>
      <description>&lt;P&gt;I'm not sure if you are looking for a "Customer Intelligence" specific tool or not. I don't have that module but a generic SAS code approach could be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sort data=have (where=(channel='TLS'))
          out=temp;
   by client_id descending date;
run;

data want;
   set temp;
   by client_id date;
   if first.client_id;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613100#M1359</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-19T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Item for getting the last response call status</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613104#M1360</link>
      <description>Hi Ballardw, I'm currently using SAS Customer Intelligence Studio for creating calculated items.</description>
      <pubDate>Thu, 19 Dec 2019 17:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613104#M1360</guid>
      <dc:creator>otepalborida</dc:creator>
      <dc:date>2019-12-19T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Calculated Item for getting the last response call status</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613113#M1361</link>
      <description>&lt;P&gt;while you can create a calculated field for this along the lines of below against contact history and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Substr(max(CAT(Put(&amp;lt;&amp;lt;/Contact &amp;amp; Response History/Contact Date&amp;gt;&amp;gt;,YYMMDD10.),&amp;lt;&amp;lt;/Contact &amp;amp; Response History/Marketing Cell Code&amp;gt;&amp;gt;)),11)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not advised as it uses SAS functions that are not resolved in the Database and will pull data to the compute tier to resolve and would have negative performance impact.&lt;/P&gt;
&lt;P&gt;A better option would be to create a database view that did a similar operation and then add the view to the info map.&lt;/P&gt;
&lt;P&gt;Something like Create view MostRecentCH_Cell_Cd as&lt;/P&gt;
&lt;P&gt;select ch.Customer_ID,&amp;nbsp; Substr(max(Concat(To_Char(CH.Contact Date),cp.Marketing Cell Code)),11)&lt;/P&gt;
&lt;P&gt;from cdm.ci_contact_History CH join cdm.CI_Cell_package cp on cp.cell_package_Sk = ch.cell_package_sk&lt;/P&gt;
&lt;P&gt;group by ch.customer_ID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note your example should just involve a single Transaction table.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 17:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-a-Calculated-Item-for-getting-the-last-response-call/m-p/613113#M1361</guid>
      <dc:creator>SteveMarshall</dc:creator>
      <dc:date>2019-12-19T17:43:43Z</dc:date>
    </item>
  </channel>
</rss>

