<?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: CALCULATED ITEM in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/CALCULATED-ITEM/m-p/342161#M368</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Home, Work and Celluar number are all columns in the same table which is part of your datamart (like a customer table), then a calculated item is very straightforward. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A more generic and flexible approach is a "case" statement. You can resolve many different challenges with this thing. In this case, it will be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case
when &amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt; is not missing then&amp;nbsp;&amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt;
when&amp;nbsp;&amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt; is not missing then &amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt;
else &amp;lt;&amp;lt;/Cellular_No&amp;gt;&amp;gt;
end&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clearly you will have to replace the &amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt; tags with your actual data item identifiers, as you insert them to the formula editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this particular case, you can also try to use a coalescec&amp;nbsp;function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalescec (&amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt;, &amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt;, &amp;lt;&amp;lt;/Cellular_No&amp;gt;&amp;gt;)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If however your data are in a vertical table with one phone number per line, and a phone type indicator in another column (as it sometimes happens), choosing one phone number from such table would also be possible, but a little bit more trickier. This I think goes beyond the scope of your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 21:17:03 GMT</pubDate>
    <dc:creator>Dmitry_Alergant</dc:creator>
    <dc:date>2017-03-17T21:17:03Z</dc:date>
    <item>
      <title>CALCULATED ITEM</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/CALCULATED-ITEM/m-p/342134#M367</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a calculated item to use in my COMMUNICATION_NODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculated item =&amp;gt; CONTACT_NO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Logic:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;contact_no = home_no&lt;/LI&gt;&lt;LI&gt;if home_no is empty then contact_no = work_no&lt;/LI&gt;&lt;LI&gt;if work_no is empty then contact_no = celluar_no&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just not quite sure how to setup the formula in the CALCULATED_ITEM expression section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/CALCULATED-ITEM/m-p/342134#M367</guid>
      <dc:creator>keiwo</dc:creator>
      <dc:date>2017-03-17T19:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: CALCULATED ITEM</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/CALCULATED-ITEM/m-p/342161#M368</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Home, Work and Celluar number are all columns in the same table which is part of your datamart (like a customer table), then a calculated item is very straightforward. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A more generic and flexible approach is a "case" statement. You can resolve many different challenges with this thing. In this case, it will be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case
when &amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt; is not missing then&amp;nbsp;&amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt;
when&amp;nbsp;&amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt; is not missing then &amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt;
else &amp;lt;&amp;lt;/Cellular_No&amp;gt;&amp;gt;
end&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clearly you will have to replace the &amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt; tags with your actual data item identifiers, as you insert them to the formula editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In this particular case, you can also try to use a coalescec&amp;nbsp;function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalescec (&amp;lt;&amp;lt;/Home_No&amp;gt;&amp;gt;, &amp;lt;&amp;lt;/Work_No&amp;gt;&amp;gt;, &amp;lt;&amp;lt;/Cellular_No&amp;gt;&amp;gt;)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If however your data are in a vertical table with one phone number per line, and a phone type indicator in another column (as it sometimes happens), choosing one phone number from such table would also be possible, but a little bit more trickier. This I think goes beyond the scope of your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 21:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/CALCULATED-ITEM/m-p/342161#M368</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2017-03-17T21:17:03Z</dc:date>
    </item>
  </channel>
</rss>

