<?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: Dynamically load and fill variables from a table (through a loop) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529897#M748701</link>
    <description>&lt;P&gt;That's it, thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Eelco&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jan 2019 09:54:24 GMT</pubDate>
    <dc:creator>cdss-developer</dc:creator>
    <dc:date>2019-01-14T09:54:24Z</dc:date>
    <item>
      <title>Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1528506#M748697</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I made this dashboard&amp;nbsp;that helps me find certain combinations (text and numbers) from large pieces of text (Table: 'DATA''). This is just an example. In this case I'm always looking&amp;nbsp;for a combination of two characters with variable amount of&amp;nbsp;numbers.&lt;/P&gt;&lt;P&gt;This works fine. However, I have a lot of these combinations (see TABLE1, this is just a small selection) and I do not want to copy the same code every time. Like I do right now, by each time: filling it with other characters and another amount of&amp;nbsp; digits. It would be nice, that I just have to alter TABLE1 or can&amp;nbsp; reload a Excel file.&lt;/P&gt;&lt;P&gt;It would be nice that the 'RETRIEVAL' code goes through a loop and that the two characters and the amount of characters&amp;nbsp;total presented&amp;nbsp;are loaded dynamically from the TABLE1-table (TABLE1).&lt;/P&gt;&lt;P&gt;I hope my explanation is clear, otherwise please let me know.&lt;BR /&gt;Can anyone please help me achieve this?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eelco&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//Code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, TEXT&lt;BR /&gt;1, 904OIE4Q09AKJN3QLKNMFWH9846DJKJWL45&lt;BR /&gt;2, djalkkj489uquirfhe43hjkDE412657djwe&lt;BR /&gt;3, lokjerjAQkoiKLDSp34ojWE5787884565456218iuafjklohasfdkjWH9845djkw456&lt;BR /&gt;4, lkjslkjkjlwe89iQF845698752sdfjkle&lt;BR /&gt;5, jlkkjl0923jkkllkdjfjkljkl545654ads&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TABLE1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;CODE, LENGTH&lt;BR /&gt;DE, 8&lt;BR /&gt;WH, 6&lt;BR /&gt;QF, 9&lt;BR /&gt;WE,&amp;nbsp;10&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;RETRIEVAL:&lt;BR /&gt;LOAD&lt;BR /&gt;ID, mid([TEXT],Index([TEXT],'DE')+0,8) AS RESULT&lt;BR /&gt;Resident DATA;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;ID, mid([TEXT],Index([TEXT],'WH')+0,6) AS RESULT&lt;BR /&gt;Resident DATA;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;ID, mid([TEXT],Index([TEXT],'QF')+0,9) AS RESULT&lt;BR /&gt;Resident DATA;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;ID, mid([TEXT],Index([TEXT],'WE')+0,10) AS RESULT&lt;BR /&gt;Resident DATA;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1528506#M748697</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2024-11-16T04:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1528974#M748698</link>
      <description>&lt;P&gt;You could use such table and looping through all values, like:&lt;/P&gt;&lt;P&gt;for i = 0 to noofrows('TABLE1') - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vChar = peek('CODE', $(i), 'TABLE');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vLength = peek('LENGTH', $(i), 'TABLE');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RETRIEVAL: LOAD ID, mid([TEXT],Index([TEXT],'$(vChar)')+0,$(vLength)) AS RESULT&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Resident DATA;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;By larger datasets in one or maybe both tables such looping might need some times. An alternatively might be to change the string with mapsubstring() and to pick the needed parts afterwards but depending of your real requirements it might not very easy to apply such a pick logic.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 12:58:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1528974#M748698</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-10T12:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529846#M748699</link>
      <description>&lt;P&gt;Hi Marcus,&lt;BR /&gt;&lt;BR /&gt;Thank you for your response!&lt;/P&gt;&lt;P&gt;I have changed the code, but unfortunately it only seems to work partially (see attached).&lt;BR /&gt;It only returns 'DE412657'.&amp;nbsp; And I would expect that&amp;nbsp;it also returns 'QF8456987', 'WE57878845' and 'WH9845' as RESULT.&lt;/P&gt;&lt;P&gt;I think doing something wrong, can&amp;nbsp;you help me further?&lt;/P&gt;&lt;P&gt;Thanks.&lt;BR /&gt;Eelco&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 08:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529846#M748699</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2019-01-14T08:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529896#M748700</link>
      <description>&lt;P&gt;It was just a small typo because the table is TABLE1 and not TABLE:&lt;/P&gt;&lt;P&gt;TABLE1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;CODE, LENGTH&lt;BR /&gt;DE, 8&lt;BR /&gt;WH, 6&lt;BR /&gt;QF, 9&lt;BR /&gt;WE, 10&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;for i = 0 to noofrows('TABLE1') - 1&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vChar = peek('CODE', $(i), 'TABLE&lt;STRONG&gt;1&lt;/STRONG&gt;');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vLength = peek('LENGTH', $(i), 'TABLE&lt;STRONG&gt;1&lt;/STRONG&gt;');&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; RETRIEVAL: LOAD ID, mid([TEXT],Index([TEXT],'$(vChar)')+0,$(vLength)) AS RESULT,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rowno() as RowNo, $(i) as LoopIteration, '$(vChar)' as vChar, $(vLength) as vLength&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Resident DATA;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CharLoop.JPG" style="width: 382px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3685i5DDB39878A991F17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CharLoop.JPG" alt="CharLoop.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 09:51:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529896#M748700</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-14T09:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529897#M748701</link>
      <description>&lt;P&gt;That's it, thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Eelco&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 09:54:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1529897#M748701</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2019-01-14T09:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616244#M748702</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a similar request. I would like to load and saved tables according to a excel table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the image below shows the field I would like to have by Plant (i.e. HEP, HEN, etc)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tale selector.JPG" style="width: 429px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/17710i00514E77064DDFC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="tale selector.JPG" alt="tale selector.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I would like to have sth like this:&lt;/P&gt;&lt;P&gt;Plant_Name:&lt;BR /&gt;LOAD&lt;BR /&gt;(here I would like to have the selection made in the excel)&lt;BR /&gt;From []&lt;BR /&gt;WHERE Plant_Name=(the correspoding plant);&lt;BR /&gt;STORE Plant_Name INTO [] (qvd);&lt;/P&gt;&lt;P&gt;note: my data source is QVD file which has all plants and all fields&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 01:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616244#M748702</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2019-08-24T01:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616416#M748703</link>
      <description>&lt;P&gt;On a first look it seems not very similar to the origin query else creating of multiple load-statements with conditions on the fly. However it's quite unclear how the conditions should be applied - here specified as a&amp;nbsp; crosstable and anyhow on a field-level ... ?&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 06:59:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616416#M748703</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-08-26T06:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616474#M748704</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is to link an Excel table (control table) which tell me which fields should be placed in the load statement for each company.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the image below is shown the Excel file structure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Control table.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/17751i76614B2051C07D84/image-size/large?v=v2&amp;amp;px=999" role="button" title="Control table.JPG" alt="Control table.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then, I would like to create a code which allows me to create a QVD file by Company and selecting ONLY the fields already selected by Company in the excel file.&lt;/P&gt;&lt;P&gt;For example, for Company 2 I should have one QVD with 4 fields and for Company 3 one QVD with 23 fields.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Edi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 09:18:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616474#M748704</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2019-08-26T09:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616499#M748705</link>
      <description>&lt;P&gt;It's just written down but I think the main-logic might be look like the following:&lt;/P&gt;&lt;P&gt;t1: crosstable(Company, Value, 2) load * from Excel;&lt;/P&gt;&lt;P&gt;for i = 1 to fieldvaluecount('Company')&lt;BR /&gt;&amp;nbsp;&amp;nbsp; let vCompany = fieldvalue('Company', $(i));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; t2: load concat(Fields, ', ') as FieldsSelected from t1 where Company = '$(vCompany)' and Value = 'x';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; let vFields = fieldvalue(FieldsSelected, 1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; t3: load '$(vFields) from QVD where Company = '$(vCompany)' ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; store t3 into $(vCompany).qvd (qvd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; drop tables t3, t2;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;You may need some adjustments here and there&amp;nbsp; especially if you want to include the tags and/or that there are spaces or special chars within the fieldnames which requires an appropriate wrapping with [ it might be sensible to add it within the excel ] and/or if there should be some renaming, too or something similar.&lt;/P&gt;&lt;P&gt;Further it might be useful not to try the whole approach at once else just to TRACE the loop and the variables within the debugger to check that the results really look as if you had written them manually.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 10:57:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616499#M748705</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-08-26T10:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616659#M748706</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;Thank you so much! it has been very helpful, however still I have mistake.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Loop Fields selected.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/17783i419D03C387A63C7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Loop Fields selected.JPG" alt="Loop Fields selected.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can observe, apparently the variable vFields is not working properly. Apparently, there is an extra comma ... To make sure the variable vFields takes the right fields, I checked values in Table_2 and the Fields selected are separated by comma and the last field it is w/o comma, which is correct.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Edi&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 14:24:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616659#M748706</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2019-08-26T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically load and fill variables from a table (through a loop)</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616665#M748707</link>
      <description>&lt;P&gt;I think I would add some TRACE statements with the variables to ensure their content. Also uncommenting the most inner statements (and their related ones - means if you don't create a table you could drop them afterwards) and to watch then the results is often helpful to find the issue - probably just a small thing ... and if it runs too long just reduce the tables for the testing.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 14:39:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-load-and-fill-variables-from-a-table-through-a-loop/m-p/1616665#M748707</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-08-26T14:39:14Z</dc:date>
    </item>
  </channel>
</rss>

