<?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 can I LOAD a row-based attribute database table into a standard column-based structure? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-LOAD-a-row-based-attribute-database-table-into-a/m-p/236831#M714694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;EM&gt;&lt;STRONG&gt;MyTable&lt;/STRONG&gt;&lt;/EM&gt; structure in the database is as follows:&lt;BR /&gt;&lt;STRONG&gt;RecordKey | FieldTag | FieldValue&lt;BR /&gt;&lt;/STRONG&gt;10 | Name | Frank&lt;BR /&gt;10 | Age | 22&lt;BR /&gt;10 | Sex | Male&lt;BR /&gt;10 | Zip | 12345&lt;BR /&gt;20 | Name | Mary&lt;BR /&gt;20 | Age | 39&lt;BR /&gt;20 | Sex | Female&lt;BR /&gt;20 | Zip | 54321&lt;BR /&gt;...etc...&lt;/P&gt;&lt;P&gt;I want to LOAD it into QlikView as a more standard columnar structure like this:&lt;BR /&gt;&lt;STRONG&gt;ID | Name | Age | Sex | Zip&lt;BR /&gt;&lt;/STRONG&gt;10 | Frank | 22 | Male | 12345&lt;BR /&gt;20 | Mary | 39 | Female | 54321&lt;BR /&gt;...etc...&lt;/P&gt;&lt;P&gt;I suspect this is because the software vendor implemented a proprietary XML data acces layer for the dependent application. However, I want to generate some reports and it is easier to work with a standard columnar structure. What is the most efficient way to do this at LOAD time in QlikView 9? I can't seem to figure out the more advanced LOAD scripting functions. Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Oct 2010 20:41:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-13T20:41:33Z</dc:date>
    <item>
      <title>How can I LOAD a row-based attribute database table into a standard column-based structure?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-LOAD-a-row-based-attribute-database-table-into-a/m-p/236831#M714694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;EM&gt;&lt;STRONG&gt;MyTable&lt;/STRONG&gt;&lt;/EM&gt; structure in the database is as follows:&lt;BR /&gt;&lt;STRONG&gt;RecordKey | FieldTag | FieldValue&lt;BR /&gt;&lt;/STRONG&gt;10 | Name | Frank&lt;BR /&gt;10 | Age | 22&lt;BR /&gt;10 | Sex | Male&lt;BR /&gt;10 | Zip | 12345&lt;BR /&gt;20 | Name | Mary&lt;BR /&gt;20 | Age | 39&lt;BR /&gt;20 | Sex | Female&lt;BR /&gt;20 | Zip | 54321&lt;BR /&gt;...etc...&lt;/P&gt;&lt;P&gt;I want to LOAD it into QlikView as a more standard columnar structure like this:&lt;BR /&gt;&lt;STRONG&gt;ID | Name | Age | Sex | Zip&lt;BR /&gt;&lt;/STRONG&gt;10 | Frank | 22 | Male | 12345&lt;BR /&gt;20 | Mary | 39 | Female | 54321&lt;BR /&gt;...etc...&lt;/P&gt;&lt;P&gt;I suspect this is because the software vendor implemented a proprietary XML data acces layer for the dependent application. However, I want to generate some reports and it is easier to work with a standard columnar structure. What is the most efficient way to do this at LOAD time in QlikView 9? I can't seem to figure out the more advanced LOAD scripting functions. Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 20:41:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-LOAD-a-row-based-attribute-database-table-into-a/m-p/236831#M714694</guid>
      <dc:creator />
      <dc:date>2010-10-13T20:41:33Z</dc:date>
    </item>
    <item>
      <title>How can I LOAD a row-based attribute database table into a standard column-based structure?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-LOAD-a-row-based-attribute-database-table-into-a/m-p/236832#M714695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi stephen, it seems you have a cube-like structure there. I haven´t worked with "generic load" much, so I can't tell about performance. Generic load gives the effect you are looking for, however, it doesn't not build a single table as joining could do, it actually manages the relations through data model linking. The second option, as you might guessed, would be joining, I left the code of both approaches here, as well as an enclosed qvw, so you can see which one fits you better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//1st option Use generic load&lt;/P&gt;&lt;P&gt;//Data:&lt;BR /&gt;//generic load * inline [&lt;BR /&gt;//RecordKey, FieldTag, FieldValue&lt;BR /&gt;//10, Name, Frank&lt;BR /&gt;//10, Age, 22&lt;BR /&gt;//10, Sex, Male&lt;BR /&gt;//10, Zip, 12345&lt;BR /&gt;//20, Name, Mary&lt;BR /&gt;//20, Age, 39&lt;BR /&gt;//20, Sex, Female&lt;BR /&gt;//20, Zip, 54321];&lt;/P&gt;&lt;P&gt;//2nd option Use joining&lt;/P&gt;&lt;P&gt;set v_attr_list = 'Name', 'Age', 'Sex', 'Zip';&lt;BR /&gt;set v_attr_first = 'Name';&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;load * inline [&lt;BR /&gt;RecordKey, FieldTag, FieldValue&lt;BR /&gt;10, Name, Frank&lt;BR /&gt;10, Age, 22&lt;BR /&gt;10, Sex, Male&lt;BR /&gt;10, Zip, 12345&lt;BR /&gt;20, Name, Mary&lt;BR /&gt;20, Age, 39&lt;BR /&gt;20, Sex, Female&lt;BR /&gt;20, Zip, 54321];&lt;/P&gt;&lt;P&gt;for each attr in $(v_attr_list)&lt;BR /&gt;&lt;BR /&gt; if '$(attr)' = '$(v_attr_first)' then&lt;BR /&gt;&lt;BR /&gt; NewData:&lt;BR /&gt; Load RecordKey,FieldValue as $(attr)&lt;BR /&gt; resident Data&lt;BR /&gt; where FieldTag = '$(attr)';&lt;BR /&gt;&lt;BR /&gt; else&lt;BR /&gt;&lt;BR /&gt; JoinData:&lt;BR /&gt; join(NewData)&lt;BR /&gt; Load RecordKey,FieldValue as $(attr)&lt;BR /&gt; resident Data&lt;BR /&gt; where FieldTag = '$(attr)';&lt;BR /&gt;&lt;BR /&gt; end if&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;drop table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you choose the joining approach, perhaps the "keep" statement can be faster than a where clause, at least, it has happend to me, when working with large amount of data.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 22:07:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-LOAD-a-row-based-attribute-database-table-into-a/m-p/236832#M714695</guid>
      <dc:creator />
      <dc:date>2010-10-13T22:07:17Z</dc:date>
    </item>
  </channel>
</rss>

