<?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 Using variables within variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232416#M499826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the next:&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;avg( { 1 &amp;lt;Year = {$(vMaxYrR1),$(vMaxYrR2) ... etc)&lt;/P&gt;&lt;P&gt;,DImensionThatYouUseInTheTable)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2011 12:49:02 GMT</pubDate>
    <dc:creator>christian77</dc:creator>
    <dc:date>2011-04-28T12:49:02Z</dc:date>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232413#M499823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to imbed variables within a variable to dynamically limit an average calculation to certain years in the database.&lt;/P&gt;&lt;P&gt;For example, when I place&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=avg( {1&amp;lt;Year={2009,2010,2011}&amp;gt;} Days_Lost)&lt;/PRE&gt;in a variable named CurrentYear, it will give me the average days lost for just the three years 2009, 2010, and 2011. I created three variables, vMaxYrR1, vMaxYrR2, and vMaxYrR3, where I place &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=Max (sig_closeYr,1),=Max (sig_closeYr,2), and =Max (sig_closeYr,3)&lt;/PRE&gt;respectively in the three variables. I then changed CurrentYear to read &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;=avg( {1&amp;lt;Year={vMaxYrR1, vMaxYrR2, vMaxYrR3}&amp;gt;} Days_Lost)&lt;/PRE&gt;. This does not produce any results. Can anyone suggest a resolution to this?&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I am new to QlikView and would really appreciate your help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 18:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232413#M499823</guid>
      <dc:creator />
      <dc:date>2011-04-27T18:56:26Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232414#M499824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you put an expression on the variable, you need to evaluate it on the set analysis to use it:&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;avg( { 1 &amp;lt;Year = {$(vMaxYrR1),$(vMaxYrR2) ... etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 18:59:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232414#M499824</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-04-27T18:59:21Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232415#M499825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Erich. That worked. However, it now leads to another problem. When using {1}, one expects to get a full result, over-riding current selections. If I also embed the variables as illustrated above, now when current selections change, so does the value of the expression. Any hints on how to change that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 12:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232415#M499825</guid>
      <dc:creator />
      <dc:date>2011-04-28T12:05:18Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232416#M499826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the next:&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;avg( { 1 &amp;lt;Year = {$(vMaxYrR1),$(vMaxYrR2) ... etc)&lt;/P&gt;&lt;P&gt;,DImensionThatYouUseInTheTable)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 12:49:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232416#M499826</guid>
      <dc:creator>christian77</dc:creator>
      <dc:date>2011-04-28T12:49:02Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232417#M499827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the tip but it didn't work. Its too bad because now I have to hard code the year values in the expressions. I was hoping to use the max function to get a specific year and the previous year no matter what data was in the data set.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 18:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232417#M499827</guid>
      <dc:creator />
      <dc:date>2011-04-29T18:14:15Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232418#M499828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Inside set analysis you can make:&lt;/P&gt;&lt;P&gt;&amp;lt;Year = $(=max({1}Year))&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 18:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232418#M499828</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-04-29T18:28:16Z</dc:date>
    </item>
    <item>
      <title>Using variables within variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232419#M499829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-style: italic; font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-style: italic; font-weight: bold"&gt;Hey, Erich. Thank you. This worked out great. I wouldn't have found it without your help.&lt;/P&gt;&lt;P style="font-style: italic; font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-style: italic; font-weight: bold"&gt;Frank&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 20:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-variables-within-variables/m-p/232419#M499829</guid>
      <dc:creator />
      <dc:date>2011-04-29T20:16:48Z</dc:date>
    </item>
  </channel>
</rss>

