<?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 Qlikview novice - Issue with Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-novice-Issue-with-Variables/m-p/175999#M44176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable which I have declared as below.&lt;/P&gt;&lt;P&gt;LET vFinanceYearPeriod = peek('MinFY');&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;I have also the variable to create a sub table using the code below. This works and I can check that the variables populated with the required values.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Temp:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SELECT CustomerType,&lt;BR /&gt; GLAmountOrder,&lt;BR /&gt; ExRateToGBP,&lt;BR /&gt; GBPAmountBudget,&lt;BR /&gt; GBPAmountInvoice,&lt;BR /&gt; GBPAmountOrder,&lt;BR /&gt; mid(FinanceYearPeriod,1,4) as FinanceYear&lt;BR /&gt;resident Transactions&lt;BR /&gt;WHERE FinanceYearPeriod = $(vFinanceYearPeriod);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;My issue is that I can not use a subset of a table in the final solution. I am instead trying to use a variable that I have declared in the &lt;B&gt;"Settings"&lt;/B&gt; - Variables &lt;B&gt;"Overview"&lt;/B&gt; menu to calculate a Total figure that is displayed in charts and gauges. The variable has the following calculation&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;sum(if(FinanceYearPeriod = $(vFinanceYearPeriod),GBPAmountInvoice))&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;As you can see the selection on the if statement is the same as the selection on the load statement for my temporary table but it will return a value 0. If I change the above code so that the" FinanceYearPeriod = $(vFinanceYearPeriod)" becomes "FinanceYearPeriod &amp;lt;&amp;gt; $(vFinanceYearPeriod)" it will return me the total of all values.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;I would be grateful if anyone could let me know what I am doing wrong ?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Many thanks to all.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Mar 2010 12:49:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-11T12:49:29Z</dc:date>
    <item>
      <title>Qlikview novice - Issue with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-novice-Issue-with-Variables/m-p/175999#M44176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable which I have declared as below.&lt;/P&gt;&lt;P&gt;LET vFinanceYearPeriod = peek('MinFY');&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;I have also the variable to create a sub table using the code below. This works and I can check that the variables populated with the required values.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Temp:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;SELECT CustomerType,&lt;BR /&gt; GLAmountOrder,&lt;BR /&gt; ExRateToGBP,&lt;BR /&gt; GBPAmountBudget,&lt;BR /&gt; GBPAmountInvoice,&lt;BR /&gt; GBPAmountOrder,&lt;BR /&gt; mid(FinanceYearPeriod,1,4) as FinanceYear&lt;BR /&gt;resident Transactions&lt;BR /&gt;WHERE FinanceYearPeriod = $(vFinanceYearPeriod);&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;My issue is that I can not use a subset of a table in the final solution. I am instead trying to use a variable that I have declared in the &lt;B&gt;"Settings"&lt;/B&gt; - Variables &lt;B&gt;"Overview"&lt;/B&gt; menu to calculate a Total figure that is displayed in charts and gauges. The variable has the following calculation&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;sum(if(FinanceYearPeriod = $(vFinanceYearPeriod),GBPAmountInvoice))&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;As you can see the selection on the if statement is the same as the selection on the load statement for my temporary table but it will return a value 0. If I change the above code so that the" FinanceYearPeriod = $(vFinanceYearPeriod)" becomes "FinanceYearPeriod &amp;lt;&amp;gt; $(vFinanceYearPeriod)" it will return me the total of all values.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;I would be grateful if anyone could let me know what I am doing wrong ?&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Many thanks to all.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Mar 2010 12:49:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-novice-Issue-with-Variables/m-p/175999#M44176</guid>
      <dc:creator />
      <dc:date>2010-03-11T12:49:29Z</dc:date>
    </item>
  </channel>
</rss>

