<?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: Reusing variables created in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288754#M868430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add, I now want to create a third variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Var3: Var1/Var2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or I want to be able to do it in an expression but currently I am not getting the right result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2016 11:33:48 GMT</pubDate>
    <dc:creator>alwayslearning</dc:creator>
    <dc:date>2016-12-06T11:33:48Z</dc:date>
    <item>
      <title>Reusing variables created in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288753#M868429</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 am creating variables in my script.&amp;nbsp; I wanted to know can you utilise those created variables in the same script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g I want to be able to divide two variables I've created&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Var1 = 'sum(Int1+int2)';&lt;/P&gt;&lt;P&gt;Let Var2 = 'sum(Int3+Int4)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I now divide Var1/var2? in my script and if I can, can you help me with the syntax.&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, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288753#M868429</guid>
      <dc:creator>alwayslearning</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing variables created in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288754#M868430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add, I now want to create a third variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Var3: Var1/Var2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or I want to be able to do it in an expression but currently I am not getting the right result&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 11:33:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288754#M868430</guid>
      <dc:creator>alwayslearning</dc:creator>
      <dc:date>2016-12-06T11:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing variables created in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288755#M868431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can utilize the variables in the script, but not those ones. Sum() is not legal in the load script except in a load. If you need to divide the two values, you will need to create them in a load statement, then peek the values to variables, and then divide the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T1:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD Sum(Int1 + Int2) as Sum1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By ....&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load Sum(Int3 + Int4) as Sum2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By ....&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let Var1 = Peek('Sum1', 1, 'T1');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let Var2 = Peek('Sum2', 1, 'T2');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let Var3 = Var1 / Var2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Optional&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP Tables T1, T2;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 11:35:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288755#M868431</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-12-06T11:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing variables created in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288756#M868432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, that answers my root cause.&amp;nbsp; I am currently changing my dashboard to one that has a 3 tier architecture and have to bring all my variables I created using the variable overview to the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have done is just put the Var I created in the script in ' ' because I have various set analysis/sums etc and this seems to work, but gives me incorrect values when I divide variables created this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In future, I will use Load Statements for any calculations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 12:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-variables-created-in-Load-Script/m-p/1288756#M868432</guid>
      <dc:creator>alwayslearning</dc:creator>
      <dc:date>2016-12-06T12:54:23Z</dc:date>
    </item>
  </channel>
</rss>

