<?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: Creating Calculated varible - compare response date with today in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-Calculated-varible-compare-response-date-with-today/m-p/736532#M1713</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282385"&gt;@misko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I normally use this function - INTCK when comparing dates. For example, I have 2 dates: TODAY_calc and DATE_calc. I can subtract the DATE_calc from TODAY_calc and see if the difference is within 7 days or more than that. Check the value first using test mode to ensure your comparing the right values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;intck('day', &amp;lt;&amp;lt;calculatedDataItems.TODAY_calc&amp;gt;&amp;gt;, &amp;lt;&amp;lt;calculatedDataItems.DATE_calc&amp;gt;&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use an IIF statement to add in your business logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;iif(intck('day', &amp;lt;&amp;lt;calculatedDataItems.TODAY_calc&amp;gt;&amp;gt;, &amp;lt;&amp;lt;calculatedDataItems.LEADACTIVITYDATE_calc&amp;gt;&amp;gt;) &amp;lt; 7, &lt;BR /&gt;&amp;lt;&amp;lt;value if true&amp;gt;&amp;gt; ,&amp;lt;&amp;lt;value if false&amp;gt;&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this can help you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 01:37:20 GMT</pubDate>
    <dc:creator>jcawesome</dc:creator>
    <dc:date>2021-04-23T01:37:20Z</dc:date>
    <item>
      <title>Creating Calculated varible - compare response date with today</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-Calculated-varible-compare-response-date-with-today/m-p/736370#M1712</link>
      <description>&lt;DIV class="main"&gt;&lt;DIV class=" big"&gt;&lt;DIV class="GyAeWb"&gt;&lt;DIV class="D6j0vc"&gt;&lt;DIV&gt;&lt;DIV class="eqAnXb"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="ULSxyf"&gt;&lt;DIV class="KIy09e obcontainer wDYxhc"&gt;&lt;DIV&gt;&lt;DIV class="YQaNob"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="tw-src-ltr"&gt;&lt;DIV class="oSioSc"&gt;&lt;DIV&gt;&lt;DIV class="g9WsWb"&gt;&lt;DIV class="tw-ta-container hide-focus-ring tw-nfl"&gt;&lt;PRE class="tw-data-text tw-text-large XcVN5d tw-ta"&gt;&lt;SPAN class="Y2IQFc"&gt;RTDM campaign needs to check whether the client has already given a response &lt;BR /&gt;during the day or in the last 7 days. I created a data process (in CI studio - RTDM campaign) &lt;BR /&gt;that "collects" data from the CI_RESPONSE_HISTORY_CUSTS table. The idea is to separate those who &lt;BR /&gt;gave an answer during the day through Branch node (or Filter) and send them a certain message, &lt;BR /&gt;from those who did not give an answer. I tried to create a calculated variable in various ways &lt;BR /&gt;(one of them is this IIF ((DATDIF (&amp;lt;&amp;lt; GetResponseData.Get Response Data_CRM_SLresponse_dt &amp;gt;&amp;gt;, TODAY ()) EQ 1), 1, 0) &lt;BR /&gt;but I did not get the desired result. Any idea?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Apr 2021 11:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-Calculated-varible-compare-response-date-with-today/m-p/736370#M1712</guid>
      <dc:creator>misko</dc:creator>
      <dc:date>2021-04-22T11:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Calculated varible - compare response date with today</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-Calculated-varible-compare-response-date-with-today/m-p/736532#M1713</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282385"&gt;@misko&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I normally use this function - INTCK when comparing dates. For example, I have 2 dates: TODAY_calc and DATE_calc. I can subtract the DATE_calc from TODAY_calc and see if the difference is within 7 days or more than that. Check the value first using test mode to ensure your comparing the right values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;intck('day', &amp;lt;&amp;lt;calculatedDataItems.TODAY_calc&amp;gt;&amp;gt;, &amp;lt;&amp;lt;calculatedDataItems.DATE_calc&amp;gt;&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use an IIF statement to add in your business logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;iif(intck('day', &amp;lt;&amp;lt;calculatedDataItems.TODAY_calc&amp;gt;&amp;gt;, &amp;lt;&amp;lt;calculatedDataItems.LEADACTIVITYDATE_calc&amp;gt;&amp;gt;) &amp;lt; 7, &lt;BR /&gt;&amp;lt;&amp;lt;value if true&amp;gt;&amp;gt; ,&amp;lt;&amp;lt;value if false&amp;gt;&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this can help you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 01:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Creating-Calculated-varible-compare-response-date-with-today/m-p/736532#M1713</guid>
      <dc:creator>jcawesome</dc:creator>
      <dc:date>2021-04-23T01:37:20Z</dc:date>
    </item>
  </channel>
</rss>

