<?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>article Loading spreadsheets with nested columns in Member Articles</title>
    <link>https://community.qlik.com/t5/Member-Articles/Loading-spreadsheets-with-nested-columns/ta-p/1494491</link>
    <description>&lt;P&gt;have you ever tried to load a spreadsheet that looks like this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 190px; width: 620px;" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/115277_Spreadsheet.png" border="0" alt="Spreadsheet.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly , i believe that this spreadsheet is pretty straight forward spreadsheet, however this is not a trivial spreadsheet for Qlik to load because its formatted as&amp;nbsp; pivot table with multiple (3) nested column headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to load ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were thinking crosstable then you are on the right track . This technique is articulated in an excellent video resource by Mike tarallo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-8231" target="_blank"&gt;Power of Qlik Script - Reshaping Data with Crosstable (video)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you'll need more if you want to unpivot each column into a tabular format that is ideal for Qlik:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: auto;" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/115278_QLikTable.jpg" border="0" alt="QLikTable.jpg" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The technique described here is to perform successive crosstable loads on the spreadsheet where each load reads just a single row (per column header) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;The Data Load Script:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. The first step is to load the spreadsheet without any transformation. I recommend doing this so that Qlik only reads the spreadsheet once which , if the spreadsheet is very large and complex, will make things quicker.&amp;nbsp;&amp;nbsp; The spreadsheet used here has no column names, so generic columns names "F1,F2,F3.."&amp;nbsp; show up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 404px; width: 620px;" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/115279_Section1.JPG" border="0" alt="Section1.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Next,&amp;nbsp; we focus on loading the column identifiers (F1,F2 etc...) with the country values that appear in each column.&amp;nbsp; The column identifier i have named 'ExcelColumn' .&amp;nbsp; The first column does not actually have a country value in it , so i rename F1 to 'Unnecessaryfield'&amp;nbsp; and drop it after the load.&amp;nbsp;&amp;nbsp; Also , this crosstable load is ONLY loading the 3rd row of the spreadsheet where F1='Country'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 305px; width: 620px;" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/115280_Section2.JPG" border="0" alt="Section2.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of this load is just a 2 column tabular data set that associates the ExcelColumn with a Country&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 383px; width: 620px;" class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/115281_Section2-b.JPG" border="0" alt="Section2-b.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3.&amp;nbsp; Next step is to use the same technique to load the YEAR row and then join the result to the 'Pivot' table above.&amp;nbsp; As before, just a single row is read (F1='YEAR') , F1 is an unnecessary field with no product value that is dropped.&amp;nbsp;&amp;nbsp; Whats different is that i join the new 2 column table with ExcelColumn and YEAR to the existing 2 column table that has ExcelColumn and COUNTRY using a join statement. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 458px; width: 620px;" class="jive-image image-6" src="https://community.qlik.com/legacyfs/online/115282_Section3.JPG" border="0" alt="Section3.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This results in a 3 column table as below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 420px; width: 620px;" class="jive-image image-7" src="https://community.qlik.com/legacyfs/online/115283_Section3-b.JPG" border="0" alt="Section3-b.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN&gt;4.&amp;nbsp; The technique repeats for the Products . Identical to step 3 except PRODUCT instead of YEAR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 471px; width: 620px;" class="image-8 jive-image" src="https://community.qlik.com/legacyfs/online/115284_Section4.JPG" border="0" alt="Section4.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now we have a 4 column table as below&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 394px; width: 620px;" class="image-9 jive-image" src="https://community.qlik.com/legacyfs/online/115285_Section4-b.JPG" border="0" alt="Section4-b.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5.&amp;nbsp; Lastly we employ a proper crosstable load to load the row headers (Sales Reps)&amp;nbsp; and all the actual sales numbers . The only rows not loaded are the PRODUCT,COUNTRY, and YEAR rows.&amp;nbsp; Also, at the end&amp;nbsp; the original spreadsheet table that was loaded is no longer needed &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 460px; width: 620px;" class="image-10 jive-image" src="https://community.qlik.com/legacyfs/online/115286_Section5.JPG" border="0" alt="Section5.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And the desired table is now available...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: auto;" class="jive-image image-11" src="https://community.qlik.com/legacyfs/online/115287_QLikTable.jpg" border="0" alt="QLikTable.jpg" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 12:29:52 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2022-06-14T12:29:52Z</dc:date>
    <item>
      <title>Loading spreadsheets with nested columns</title>
      <link>https://community.qlik.com/t5/Member-Articles/Loading-spreadsheets-with-nested-columns/ta-p/1494491</link>
      <description>&lt;P&gt;have you ever tried to load a spreadsheet that looks like this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 190px; width: 620px;" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/115277_Spreadsheet.png" border="0" alt="Spreadsheet.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly , i believe that this spreadsheet is pretty straight forward spreadsheet, however this is not a trivial spreadsheet for Qlik to load because its formatted as&amp;nbsp; pivot table with multiple (3) nested column headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to load ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were thinking crosstable then you are on the right track . This technique is articulated in an excellent video resource by Mike tarallo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-8231" target="_blank"&gt;Power of Qlik Script - Reshaping Data with Crosstable (video)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you'll need more if you want to unpivot each column into a tabular format that is ideal for Qlik:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: auto;" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/115278_QLikTable.jpg" border="0" alt="QLikTable.jpg" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The technique described here is to perform successive crosstable loads on the spreadsheet where each load reads just a single row (per column header) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;The Data Load Script:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. The first step is to load the spreadsheet without any transformation. I recommend doing this so that Qlik only reads the spreadsheet once which , if the spreadsheet is very large and complex, will make things quicker.&amp;nbsp;&amp;nbsp; The spreadsheet used here has no column names, so generic columns names "F1,F2,F3.."&amp;nbsp; show up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 404px; width: 620px;" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/115279_Section1.JPG" border="0" alt="Section1.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Next,&amp;nbsp; we focus on loading the column identifiers (F1,F2 etc...) with the country values that appear in each column.&amp;nbsp; The column identifier i have named 'ExcelColumn' .&amp;nbsp; The first column does not actually have a country value in it , so i rename F1 to 'Unnecessaryfield'&amp;nbsp; and drop it after the load.&amp;nbsp;&amp;nbsp; Also , this crosstable load is ONLY loading the 3rd row of the spreadsheet where F1='Country'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 305px; width: 620px;" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/115280_Section2.JPG" border="0" alt="Section2.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of this load is just a 2 column tabular data set that associates the ExcelColumn with a Country&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="height: 383px; width: 620px;" class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/115281_Section2-b.JPG" border="0" alt="Section2-b.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3.&amp;nbsp; Next step is to use the same technique to load the YEAR row and then join the result to the 'Pivot' table above.&amp;nbsp; As before, just a single row is read (F1='YEAR') , F1 is an unnecessary field with no product value that is dropped.&amp;nbsp;&amp;nbsp; Whats different is that i join the new 2 column table with ExcelColumn and YEAR to the existing 2 column table that has ExcelColumn and COUNTRY using a join statement. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 458px; width: 620px;" class="jive-image image-6" src="https://community.qlik.com/legacyfs/online/115282_Section3.JPG" border="0" alt="Section3.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This results in a 3 column table as below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 420px; width: 620px;" class="jive-image image-7" src="https://community.qlik.com/legacyfs/online/115283_Section3-b.JPG" border="0" alt="Section3-b.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN&gt;4.&amp;nbsp; The technique repeats for the Products . Identical to step 3 except PRODUCT instead of YEAR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 471px; width: 620px;" class="image-8 jive-image" src="https://community.qlik.com/legacyfs/online/115284_Section4.JPG" border="0" alt="Section4.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now we have a 4 column table as below&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 394px; width: 620px;" class="image-9 jive-image" src="https://community.qlik.com/legacyfs/online/115285_Section4-b.JPG" border="0" alt="Section4-b.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5.&amp;nbsp; Lastly we employ a proper crosstable load to load the row headers (Sales Reps)&amp;nbsp; and all the actual sales numbers . The only rows not loaded are the PRODUCT,COUNTRY, and YEAR rows.&amp;nbsp; Also, at the end&amp;nbsp; the original spreadsheet table that was loaded is no longer needed &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: 460px; width: 620px;" class="image-10 jive-image" src="https://community.qlik.com/legacyfs/online/115286_Section5.JPG" border="0" alt="Section5.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And the desired table is now available...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG style="height: auto;" class="jive-image image-11" src="https://community.qlik.com/legacyfs/online/115287_QLikTable.jpg" border="0" alt="QLikTable.jpg" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 12:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Member-Articles/Loading-spreadsheets-with-nested-columns/ta-p/1494491</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2022-06-14T12:29:52Z</dc:date>
    </item>
  </channel>
</rss>

