<?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 How to combine more than 1 array to 1 array? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313362#M115676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply.But I prefer to use it by Macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I select a HMgStaffCode and run the Macro, the HMgStaffCode value, MgStaffCode(possible values) and StaffCode(possible values) (not only 1 field) can be combined into a &lt;STRONG&gt;array&lt;/STRONG&gt;, and then reload data and reduce data(keep possible values).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to know how to combine &lt;STRONG&gt;&lt;STRONG&gt;HMgStaffCode&lt;/STRONG&gt;, MgStaffCode,StaffCode &lt;/STRONG&gt;possible values of these 3 fields into a &lt;STRONG&gt;array &lt;/STRONG&gt;by Macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2011 01:54:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-06-24T01:54:52Z</dc:date>
    <item>
      <title>How to combine more than 1 array to 1 array?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313360#M115674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to use this combined array in Load Script. The combined array come from more than 1 array(possiblevalues).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I select a HMgStaffCode,I want to combine this HMgStaffCode value,MgStaffCode(possible values) and StaffCode(possible values) to a new array '&lt;STRONG&gt;vStaffCode&lt;/STRONG&gt;' with Macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Load Script&lt;/P&gt;&lt;P&gt;SQL Select Period,StaffCode,MgStaffCode,HMgStaffCode,Sales from Rawdata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where staffcode in '&lt;STRONG&gt;$(vStaffCode)&lt;/STRONG&gt;';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL script, the format of &lt;STRONG&gt;$(vStaffCode)&lt;/STRONG&gt; must be like ('T00123','F00236','S00634',......).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format of StaffCode&amp;amp;MgStaffCode&amp;amp;HMgStaffCode just like T00123,F00236,S00634,......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 01:42:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313360#M115674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-23T01:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine more than 1 array to 1 array?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313361#M115675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not going to pretend that I understand ALL of what you said in your question but I think the key to achieving your result is the Crosstable load and the CONCAT function. It creates a delimited list based on the values in a field over a group by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some code that illustrates how I would approach it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//it sounds like your data is found in three different fields on the same table&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//Crosstable stretches your results so they will fill the same field&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ArrayTemp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CrossTable(StaffCodeType, StaffCode, 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Load * Inline [&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Period, StaffCode, MgStaffCode, HMgStaffCode&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, T00123, F00236, S00634&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, T00123, G00236, X00634&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//Concatenate all the values and enhance the delimeter a bit&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FinalArray:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Load &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Chr(39) &amp;amp; Replace(Concat(Distinct StaffCode, ','),',',chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; Chr(39) as StaffCodeArray&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Resident&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ArrayTemp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//assign the string to a variable&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vStaffCode = peek('StaffCodeArray',0,'FinalArray');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//Use it in SQL&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Load *;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL Select * from Whatever&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Where StaffCode in ($(vStaffCode));&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 03:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313361#M115675</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2011-06-23T03:21:19Z</dc:date>
    </item>
    <item>
      <title>How to combine more than 1 array to 1 array?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313362#M115676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply.But I prefer to use it by Macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I select a HMgStaffCode and run the Macro, the HMgStaffCode value, MgStaffCode(possible values) and StaffCode(possible values) (not only 1 field) can be combined into a &lt;STRONG&gt;array&lt;/STRONG&gt;, and then reload data and reduce data(keep possible values).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to know how to combine &lt;STRONG&gt;&lt;STRONG&gt;HMgStaffCode&lt;/STRONG&gt;, MgStaffCode,StaffCode &lt;/STRONG&gt;possible values of these 3 fields into a &lt;STRONG&gt;array &lt;/STRONG&gt;by Macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 01:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313362#M115676</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-24T01:54:52Z</dc:date>
    </item>
    <item>
      <title>How to combine more than 1 array to 1 array?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313363#M115677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a guy who does many macros. Just to satisfy my curiosity and help others understand the issue could you explain what you are trying to accomplish with your Macro??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 02:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313363#M115677</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2011-06-24T02:41:44Z</dc:date>
    </item>
    <item>
      <title>How to combine more than 1 array to 1 array?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313364#M115678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have answered something related question on below post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" href="https://community.qlik.com/message/126833#126833"&gt;http://community.qlik.com/message/126833#126833&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 06:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-more-than-1-array-to-1-array/m-p/313364#M115678</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-06-24T06:24:27Z</dc:date>
    </item>
  </channel>
</rss>

