<?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: Load table modifying the structure in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482137#M180176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD Register, Field1, &lt;SPAN style="font-size: 10pt;"&gt;Field2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(peek(Register) &amp;lt;&amp;gt; Register and Register &amp;lt;&amp;gt; 'info', RowNo(), if(isnull(peek(ID)), 1, peek(ID)) ) as ID&lt;/P&gt;&lt;P&gt;FROM [Book1.xlsx] (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD Field1 as Date_Start, Field2 as Date_End, ID&lt;/P&gt;&lt;P&gt;RESIDENT Table1 WHERE Register = 'date';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;LOAD ID, Field1 as Worker, num(Field2) as Value&lt;/P&gt;&lt;P&gt;RESIDENT Table1 WHERE Register = 'info';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;drop table Table1;&lt;/P&gt;&lt;P&gt;drop field ID;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 08:50:21 GMT</pubDate>
    <dc:creator>luciancotea</dc:creator>
    <dc:date>2013-07-16T08:50:21Z</dc:date>
    <item>
      <title>Load table modifying the structure</title>
      <link>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482135#M180174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a database in excel like this structure:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="44037" alt="To modificate.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/44037_To+modificate.PNG" /&gt;&lt;/P&gt;&lt;P&gt;And I need to load this in a qlikview's table to stay like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Modificated.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/44045_Modificated.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can help me? Thanks.&lt;/P&gt;&lt;P&gt;&lt;OBJECT height="0" id="480ae8a9-4b28-b094-6a68-1b859aa4ab8e" type="application/gas-events-cef" width="0"&gt;&lt;/OBJECT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 21:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482135#M180174</guid>
      <dc:creator />
      <dc:date>2013-07-15T21:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Load table modifying the structure</title>
      <link>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482136#M180175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can loop through each record in turn, and:&lt;/P&gt;&lt;P&gt;1. if the record is a date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; - set variables to store the start and end date&lt;/P&gt;&lt;P&gt;2. if the record is not a date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; - add record to a new table using the stored start and end date&lt;/P&gt;&lt;P&gt;To do the loop you would need to test the number of records first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NewTable:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [ RowKey ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OriginalTable:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Register,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2&lt;/P&gt;&lt;P&gt;FROM .... your spreadsheet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vRowCount = NoOfRows('Register');&lt;/P&gt;&lt;P&gt;SET a = 0;&lt;/P&gt;&lt;P&gt;DO WHILE a &amp;lt;= (vRowCount-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET LoopType = peek('Register',a,'OriginalTable');&lt;/P&gt;&lt;P&gt;IF LoopType = 'date' THEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vStartDate = peek('Field1',a,'OriginalTable');&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vEndDate = peek('Field2',a,'OriginalTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vWorker = peek('Field1',a,'OriginalTable');&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vValue = peek('Field2',a,'OriginalTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CONCATENATE (NewTable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo() AS RowKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vStartDate)' AS StartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vEndDate)' AS EndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vWorker)' AS Worker,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vValue)' AS Value&lt;/P&gt;&lt;P&gt;&amp;nbsp; AUTOGENERATE 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET a = a + 1;&lt;/P&gt;&lt;P&gt;LOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 08:19:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482136#M180175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-16T08:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Load table modifying the structure</title>
      <link>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482137#M180176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD Register, Field1, &lt;SPAN style="font-size: 10pt;"&gt;Field2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(peek(Register) &amp;lt;&amp;gt; Register and Register &amp;lt;&amp;gt; 'info', RowNo(), if(isnull(peek(ID)), 1, peek(ID)) ) as ID&lt;/P&gt;&lt;P&gt;FROM [Book1.xlsx] (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD Field1 as Date_Start, Field2 as Date_End, ID&lt;/P&gt;&lt;P&gt;RESIDENT Table1 WHERE Register = 'date';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;LOAD ID, Field1 as Worker, num(Field2) as Value&lt;/P&gt;&lt;P&gt;RESIDENT Table1 WHERE Register = 'info';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;drop table Table1;&lt;/P&gt;&lt;P&gt;drop field ID;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 08:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482137#M180176</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2013-07-16T08:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Load table modifying the structure</title>
      <link>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482138#M180177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/luciancotea" id="jive-7142127350293326740937" style="background-color: #ffffff; font-size: 12px; color: #007fc0; font-weight: bold; font-family: Arial; text-align: center;"&gt;Lucian Cotea&lt;/A&gt;, this works!! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 10:31:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-table-modifying-the-structure/m-p/482138#M180177</guid>
      <dc:creator />
      <dc:date>2013-07-16T10:31:37Z</dc:date>
    </item>
  </channel>
</rss>

