<?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: How would I go about combining different fields in this certain way.. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261578#M1191668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at "Generic Load".&amp;nbsp; Unfortunately, a generic load actually makes a whole bunch of tables with the same key, one field each.&amp;nbsp; To combine them, you could write a loop to left join each new field onto a single table and drop the associated table.&amp;nbsp; I have an example of the generic load, but not of combining into a single table.&amp;nbsp; I've SEEN one, though, so perhaps you can find it with a forum search.&amp;nbsp; If not, I can either find it or create my own example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jul 2011 00:10:55 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-07-07T00:10:55Z</dc:date>
    <item>
      <title>How would I go about combining different fields in this certain way..</title>
      <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261576#M1191666</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;I need to create a table for CSV export at the end of the script, and I have fields from different tables that I need to combine, but not just glue the fields together. Here is what I mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;SomeField | Year&amp;nbsp; | Month | Number&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2008 | Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2008 | Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 14&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2008 | Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;...........&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2009 | Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 31&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2009 | Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 24&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;.........&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;I hope you get the pattern.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;So my problem is: I need to make sort of a crosstable, where i have the months as fields (so the fields would be: SomeField, Year, Jan, Feb, Mar,...) and the the Number would be a value for a particular month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;I have no idea how to go about forming this table. Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Siarhei K.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 19:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261576#M1191666</guid>
      <dc:creator />
      <dc:date>2011-07-06T19:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: How would I go about combining different fields in this certain way..</title>
      <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261577#M1191667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add some more detail to what I need to get as the result is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rows from the example would be&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;EM&gt;(this is Jan)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;12&lt;EM&gt;(this is Feb)&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;EM&gt;(this is Mar)......&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14 ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 ....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2009&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31 ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2009&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24 ....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,times;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 19:30:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261577#M1191667</guid>
      <dc:creator />
      <dc:date>2011-07-06T19:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How would I go about combining different fields in this certain way..</title>
      <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261578#M1191668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at "Generic Load".&amp;nbsp; Unfortunately, a generic load actually makes a whole bunch of tables with the same key, one field each.&amp;nbsp; To combine them, you could write a loop to left join each new field onto a single table and drop the associated table.&amp;nbsp; I have an example of the generic load, but not of combining into a single table.&amp;nbsp; I've SEEN one, though, so perhaps you can find it with a forum search.&amp;nbsp; If not, I can either find it or create my own example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 00:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261578#M1191668</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-07T00:10:55Z</dc:date>
    </item>
    <item>
      <title>How would I go about combining different fields in this certain way..</title>
      <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261579#M1191669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, John, that gave me some ideas. However, the way I'm thinking of solving my problem would be veeeery slow, O(n^4), which depends on the number of fields I have before the cross-tab switch (when the months' fields start).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siarhei K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 13:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261579#M1191669</guid>
      <dc:creator />
      <dc:date>2011-07-07T13:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How would I go about combining different fields in this certain way..</title>
      <link>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261580#M1191670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've updated the example to include joining all of the tables into one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Final]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD DISTINCT "Invoice No." // add other key fields to this list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Table]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FOR I = nooftables() TO 0 STEP -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vTable = tablename(I);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF&amp;nbsp; wildmatch('$(vTable)','Generic.*') THEN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTER JOIN ([Final])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESIDENT [$(vTable)];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END IF&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that approach, I wouldn't expect the number of fields before the switch to be particularly significant.&amp;nbsp; I'm not sure what algorithm QlikView uses for a LOAD DISTINCT, but it certainly wouldn't be o(n^4).&amp;nbsp; I'd expect o(n log n) for that part.&amp;nbsp; We can also eliminate it if necessary (the comments in my example include a more complicated version without it, though I don't guarantee that it's faster).&amp;nbsp; But maybe that's not the aspect of solving your problem that you're talking about.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 17:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-would-I-go-about-combining-different-fields-in-this-certain/m-p/261580#M1191670</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-07T17:27:50Z</dc:date>
    </item>
  </channel>
</rss>

