<?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 does this code work?Creating variables using loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705306#M677920</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;just a few words to add for anyone else looking at this - I just spent around 20min figuring out the details&lt;/P&gt;&lt;P&gt;of the code above. Of course it does work, but there are a few loopholes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- both the name of the variable as you want it and the table_name must be in quotes (that's correct here, but it's&lt;BR /&gt;&amp;nbsp;&amp;nbsp; important)&lt;/P&gt;&lt;P&gt;- The field 'VarFormula' that is referenced in the code must contain ONLY the value, not the complete SET command &lt;BR /&gt;&amp;nbsp;&amp;nbsp; or anything ... (and keep in mind the decimal_separator_settings in QlikView might not match those in Excel)&lt;/P&gt;&lt;P&gt;- For the first record, i must have the value 0 (not 1) - you can look that up in the help_file, but it's always possible to&lt;BR /&gt;&amp;nbsp;&amp;nbsp; get it wrong &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2014 09:14:32 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2014-06-20T09:14:32Z</dc:date>
    <item>
      <title>How does this code work?Creating variables using loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705302#M677915</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 stumbled across this code while studying a dashboard built by another developer.&lt;/P&gt;&lt;P&gt;At a high level I thing I know ( I'm not sure ) what happening in this code.&lt;/P&gt;&lt;P&gt;Has anyone used this code before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone explain what's happening here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="60839" alt="qvCommunity.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/60839_qvCommunity.png" style="width: 620px; height: 327px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705302#M677915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-18T17:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: How does this code work?Creating variables using loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705303#M677916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code first loads variable names and the contents for the variables from an excel file into the table CommonVariables. In the for-loop it iterates through each record of the table CommonVariables and retrieves the variable name and the variable contents. It the creates the variable in the qlikview document and assigns the variable contents to the variable. The NoOfRows function is used to find the number of records of the CommonVariables table, i.e. the number of variables that should be created. The peek function is used to look up the values of the fields from the &lt;EM&gt;i&lt;/EM&gt;-th record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:55:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705303#M677916</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-18T17:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: How does this code work?Creating variables using loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705304#M677917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code does exactly what you think: it does create new variable inside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of it, i guess, is that you can maintain a single xls full variables common to all your application and use the code to load the variables from the excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705304#M677917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-18T17:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How does this code work?Creating variables using loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705305#M677918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code opens a excel file and creates as many variables (one per line) as rows on [Common Variables] sheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:59:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705305#M677918</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2014-06-18T17:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How does this code work?Creating variables using loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705306#M677920</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;just a few words to add for anyone else looking at this - I just spent around 20min figuring out the details&lt;/P&gt;&lt;P&gt;of the code above. Of course it does work, but there are a few loopholes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- both the name of the variable as you want it and the table_name must be in quotes (that's correct here, but it's&lt;BR /&gt;&amp;nbsp;&amp;nbsp; important)&lt;/P&gt;&lt;P&gt;- The field 'VarFormula' that is referenced in the code must contain ONLY the value, not the complete SET command &lt;BR /&gt;&amp;nbsp;&amp;nbsp; or anything ... (and keep in mind the decimal_separator_settings in QlikView might not match those in Excel)&lt;/P&gt;&lt;P&gt;- For the first record, i must have the value 0 (not 1) - you can look that up in the help_file, but it's always possible to&lt;BR /&gt;&amp;nbsp;&amp;nbsp; get it wrong &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 09:14:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-does-this-code-work-Creating-variables-using-loop/m-p/705306#M677920</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-06-20T09:14:32Z</dc:date>
    </item>
  </channel>
</rss>

