<?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: Array in calculated item? in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433440#M809</link>
    <description>&lt;P&gt;Hi Dmitry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry - that was an important piece of information missing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I work in SAS MA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards/Rikke&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2018 09:38:30 GMT</pubDate>
    <dc:creator>RikkeK</dc:creator>
    <dc:date>2018-02-02T09:38:30Z</dc:date>
    <item>
      <title>Array in calculated item?</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433094#M805</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to populate multiple rows from an underlying table into a calculated item in SAS CI - Does anyone know if it's possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;A have a customer A in the customer table with a 1:N relation til a order table. In the order table I have order B, C and D that I would like to collate in one string like this 'B, C, D'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use the calculated item in export to email, where I can only export one row per customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using the calculated item, the export will contain customer id, customer email and the string 'B, C, D'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can find the last order and the first - and I can count them - but I can't find a way to show the whole array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any inputs will be appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards/Rikke&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433094#M805</guid>
      <dc:creator>RikkeK</dc:creator>
      <dc:date>2018-02-01T12:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Array in calculated item?</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433113#M806</link>
      <description>&lt;P&gt;Hi Rikke, what component of SAS CI are we talking about - SAS Marketing Automation or SAS RTDM?&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your question can be read in&amp;nbsp;two ways (as if you are talking about MA or RTDM), and seems to make sense in both, but the answers would be&amp;nbsp;quite different.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 14:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433113#M806</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2018-02-01T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Array in calculated item?</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433440#M809</link>
      <description>&lt;P&gt;Hi Dmitry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry - that was an important piece of information missing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I work in SAS MA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards/Rikke&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 09:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/433440#M809</guid>
      <dc:creator>RikkeK</dc:creator>
      <dc:date>2018-02-02T09:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Array in calculated item?</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/434465#M812</link>
      <description>&lt;P&gt;Hi Rikke,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm afraid there is no supported "one-step" solution for what you are looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One possible solution would be:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Introduce a temporary table in your database (Oracle or whatever it is) on an Order level.&lt;/LI&gt;&lt;LI&gt;Use an Export or Process node to export data to that table with selected Orders as a first step.&amp;nbsp; &amp;nbsp;\&lt;/LI&gt;&lt;LI&gt;Have a view created in a database on top of that table that implements the aggregation you need. Oracle has a function&amp;nbsp;"LISTAGG", other databases should have similar aggregate functions.&lt;/LI&gt;&lt;LI&gt;Infomap this view back to SAS MA, so it can be used for subsequent communication on a Customer level&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another possible solution would be to execute a communication on an Order level, and then use a Post Process to aggregate output records. Looks simpler and cleaner, but will leave the contact history recorded at the Order level, which may or may not be appropriate in your situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In theory, there exists another solution - very tricky and obscure. If your database supports a simple list aggregation function (like older Oracle, up until 11g2, had "&lt;STRONG&gt;wm_concat&lt;/STRONG&gt;" function),&amp;nbsp;you could try using&amp;nbsp;"&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#n0k1cax0gzsdxdn1a3466l1gwtk9.htm#n1r8mfcokckvwtn11wfefqm034ea" target="_self"&gt;SQL_FUNCTIONS=EXTERNAL_APPEND&lt;/A&gt;" libname option to "add" a newSAS SQL function alias that corresponds to&amp;nbsp;that database function, with Function Category = AGGREGATE.&amp;nbsp; And then try calling it from SAS MA Calculated Item.&amp;nbsp; It's a very deep and scary stuff and I highly doubt&amp;nbsp;it was ever tested to be used that way. You can try at your own risk and tell us the results though.&amp;nbsp; I'm not affiliated with SAS Technical Support, but in their place, i'd tell that such use case isn't supported. Newer Oracle versions (12c) do not have a simple wm_contact function and have a window function LISTAGG instead. Obviously, SAS external_append functionality cannot be extended to window functions.&amp;nbsp; Not sure about other databases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 06:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/434465#M812</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2018-02-06T06:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Array in calculated item?</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/436161#M825</link>
      <description>&lt;P&gt;Hi Dmitry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply - I thought it wouldn't be simple &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But I will give it a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards/Rikke&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 07:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Array-in-calculated-item/m-p/436161#M825</guid>
      <dc:creator>RikkeK</dc:creator>
      <dc:date>2018-02-12T07:38:34Z</dc:date>
    </item>
  </channel>
</rss>

