<?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 variables from a table in Visualization and Usability</title>
    <link>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000133#M217543</link>
    <description>&lt;P&gt;Hi Ruben, thanks for the reply.&lt;BR /&gt;This code is certainly helpful.&lt;BR /&gt;&lt;BR /&gt;I found where I made an error:&lt;BR /&gt;I use &lt;EM&gt;$(&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;vKostIntern)&lt;/EM&gt; in my expressions, which turns out to be Null.&lt;BR /&gt;When I replace this with&amp;nbsp;&lt;EM&gt;vKostIntern&lt;/EM&gt;, without &lt;EM&gt;$()&lt;/EM&gt;, everything works fine.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Previously, the value of the variable was hard-coded:&lt;BR /&gt;&lt;EM&gt;LET vKostIntern = 0.425;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;In this case both&amp;nbsp;&lt;EM&gt;$(&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;vKostIntern) &lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;vKostIntern &lt;/EM&gt;return the value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The use of &lt;EM&gt;$()&lt;/EM&gt; still keeps confusing me sometimes.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 13:28:42 GMT</pubDate>
    <dc:creator>Mark_A</dc:creator>
    <dc:date>2022-11-03T13:28:42Z</dc:date>
    <item>
      <title>Load variables from a table</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000087#M217533</link>
      <description>&lt;P&gt;I would like to load some parameters into variables from a table "Parameters":&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parameters" style="width: 317px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/92812i93304C2C2BAC0A1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Parameters.png" alt="Parameters" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Parameters&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the load script, I want to use the lookup function to store the value "Waarde" into the variable vKostIntern:&lt;/P&gt;
&lt;P&gt;LET vKostIntern = Lookup('Waarde','Parameter','vKostIntern','Parameters');&lt;/P&gt;
&lt;P&gt;I tried different things but the value of the variable remains empty.&lt;/P&gt;
&lt;P&gt;Does anyone have a solution for this?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 11:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000087#M217533</guid>
      <dc:creator>Mark_A</dc:creator>
      <dc:date>2022-11-03T11:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Load variables from a table</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000108#M217536</link>
      <description>&lt;P&gt;Hi, it should work, check again all the field and table tables, every is case-sensitive.&lt;/P&gt;
&lt;P&gt;Also confirm that the table is already loaded in data model before the LET instruction.&lt;/P&gt;
&lt;P&gt;Also note that you can create all variables from excel with a sfipt like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variables:
LOAD
  Parameter,
  Waarde
FROM ... excelFile;

FOR i = 0 to NoOfRows('Variables') - 1
    LET vParameter = Peek('Parameter',$(i),'Variables');
    LET $(vParameter) = Peek('Waarde',$(i),'Variables');
NEXT i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe Waarde needs some number formatting with Num#() and/or Num() to correctly interpret the decimal separator.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 12:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000108#M217536</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-11-03T12:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Load variables from a table</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000113#M217537</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/205426"&gt;@Mark_A&lt;/a&gt;&amp;nbsp;, I think you should use a peek function instead.&lt;/P&gt;
&lt;P&gt;I don't know how long your table is but this loop should work and create the variables for you&lt;/P&gt;
&lt;P&gt;the Trace functions are there as a testing thing. you can remove those &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Parameters:
Load * inline [
Parameter, Waarde
vTest, 10
vTest2,100
];

let row = RowNo();
for Each vFields in FieldValueList('Parameter')

  Trace - $(vFields)-;
  let $(vFields) = peek('Waarde',$(row),'Parameters');
  let row = $(row) + 1;
  Trace - $(vFields)-;


next&lt;/LI-CODE&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;</description>
      <pubDate>Thu, 03 Nov 2022 12:44:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000113#M217537</guid>
      <dc:creator>MartW</dc:creator>
      <dc:date>2022-11-03T12:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Load variables from a table</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000133#M217543</link>
      <description>&lt;P&gt;Hi Ruben, thanks for the reply.&lt;BR /&gt;This code is certainly helpful.&lt;BR /&gt;&lt;BR /&gt;I found where I made an error:&lt;BR /&gt;I use &lt;EM&gt;$(&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;vKostIntern)&lt;/EM&gt; in my expressions, which turns out to be Null.&lt;BR /&gt;When I replace this with&amp;nbsp;&lt;EM&gt;vKostIntern&lt;/EM&gt;, without &lt;EM&gt;$()&lt;/EM&gt;, everything works fine.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Previously, the value of the variable was hard-coded:&lt;BR /&gt;&lt;EM&gt;LET vKostIntern = 0.425;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;In this case both&amp;nbsp;&lt;EM&gt;$(&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;vKostIntern) &lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;vKostIntern &lt;/EM&gt;return the value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The use of &lt;EM&gt;$()&lt;/EM&gt; still keeps confusing me sometimes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 13:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Load-variables-from-a-table/m-p/2000133#M217543</guid>
      <dc:creator>Mark_A</dc:creator>
      <dc:date>2022-11-03T13:28:42Z</dc:date>
    </item>
  </channel>
</rss>

