<?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 Variable Value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342354#M126456</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;Hard to say without an example to test, but I suspect the problem is that there is no set expression on the avg() function itself, so the territory selection will affect the avg. Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg({&amp;lt;TERRITORY=&amp;gt;} aggr(..))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, the Num inside the aggr is doing nothing except making the statement more complex. If you want to format the results, the num should be the topmost expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(avg({&amp;lt;TERRITORY=&amp;gt;} aggr(..)), '0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Apr 2012 08:19:26 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-04-09T08:19:26Z</dc:date>
    <item>
      <title>Variable Value</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342353#M126455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; I have written this formula to calculate mean value of a product in all the territories and stored it in a variable. But whenever i am selecting any territory that variable value is changing. But it should remain same irrespective of whatever selection i make. what could be the reason for the difference in value. &lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt;=&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;BR /&gt; ((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={7},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))-&lt;BR /&gt; ((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume_Change&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))))/&lt;BR /&gt; ((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={7},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;%EPID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={7},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Segment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Stucks'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;} (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Volume_Change&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))))&lt;BR /&gt; &lt;BR /&gt; ,'#,##0.0%'), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TERRITORY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;to make the variable value constant we can load this formula in the load script. But i dont know how to do that. Please Help &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342353#M126455</guid>
      <dc:creator />
      <dc:date>2012-04-09T08:09:46Z</dc:date>
    </item>
    <item>
      <title>Variable Value</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342354#M126456</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;Hard to say without an example to test, but I suspect the problem is that there is no set expression on the avg() function itself, so the territory selection will affect the avg. Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg({&amp;lt;TERRITORY=&amp;gt;} aggr(..))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, the Num inside the aggr is doing nothing except making the statement more complex. If you want to format the results, the num should be the topmost expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(avg({&amp;lt;TERRITORY=&amp;gt;} aggr(..)), '0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342354#M126456</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-04-09T08:19:26Z</dc:date>
    </item>
    <item>
      <title>Variable Value</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342355#M126457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Jonathan &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 08:30:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Value/m-p/342355#M126457</guid>
      <dc:creator />
      <dc:date>2012-04-09T08:30:23Z</dc:date>
    </item>
  </channel>
</rss>

