<?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: Variable inside another variable not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727973#M260884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marcos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the below attachment. I have created a sample application for the requirement you have requested for. This might help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jan 2017 10:41:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-30T10:41:51Z</dc:date>
    <item>
      <title>Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727965#M260876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a little issue where I'm trying to transfer all my expressions into variables but in the cases where I have one expression which is part of another expression, when I change it to refer to the variable it doesn't seem to be working. The results are as if it's ignoring the second part of the expression and just give me the numbers relative to the first variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see what I've done below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vLocalPrice --&amp;gt; If(Stream = 'UNKNOWN', Avg([PAC - NA]), Avg(PAC))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula for my budget is as below. It works.&lt;/P&gt;&lt;P&gt;You can see that the bold part is my local price which is stored in vLocalPrice as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Stream = 'UNKNOWN', Avg([PAC - NA]), Avg(PAC))&lt;/STRONG&gt; * Sum(Target)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when I replace the local price expression above by my variable vLocalPrice (as below) the results are wrong. The results are the same as the results I get for from vLocalPrice. As if the exprecion below is ignoring "* Sum(Target)".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(vLocalPrice)&amp;nbsp; * Sum(Target)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a look around on the community and also some other blogs but there's no example where I have a variable calling another variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone help with this one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 05:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727965#M260876</guid>
      <dc:creator>drjoffily</dc:creator>
      <dc:date>2014-10-15T05:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727966#M260877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you putting a preceding '=' sign in your variable definition? If so, try removing that. Otherwise, create and share a qvw with sample data that demonstrates the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 05:37:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727966#M260877</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-10-15T05:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727967#M260878</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;This is working, don't give = in variable declaration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vLocalPrice --&amp;gt; If(Stream = 'UNKNOWN', Avg([PAC - NA]), Avg(PAC))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;and &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=$(vLocalPrice)&amp;nbsp; * Sum(Target)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If it is not working then try like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vLocalPrice --&amp;gt;&amp;nbsp; Avg({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Stream = {'UNKNOWN'}&lt;/SPAN&gt;&amp;gt;}[PAC - NA]) +&amp;nbsp; Avg(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Stream -= {'UNKNOWN'}&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;gt;}&lt;/SPAN&gt;PAC)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;and &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=$(vLocalPrice)&amp;nbsp; * Sum(Target)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Is &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Stream is there in your dimension?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 05:43:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727967#M260878</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-10-15T05:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727968#M260879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick turnover tresesco.&lt;/P&gt;&lt;P&gt;No I'm not using '=' in my variable definitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it'll be too hard for me to create a dummy version of my model. It's too complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hopping it'd be something obvious in my syntax that someone could spot straight away. Does that mean the syntax is correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would you add a variable inside another variable? Could you give me an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason I'm asking is because, as I said below, when I replace the variable by the actual expression it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is the expression I'm using in my straight table:&lt;/P&gt;&lt;P&gt;=$(vBudget)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vBudget --&amp;gt; &lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(Stream = 'UNKNOWN', Avg([PAC - NA]), Avg(PAC))&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; * Sum(Target)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 05:46:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727968#M260879</guid>
      <dc:creator>drjoffily</dc:creator>
      <dc:date>2014-10-15T05:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727969#M260880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. Yes, Stream is my dimension.&lt;/P&gt;&lt;P&gt;Your set analysis is summing PAC-NA with PAC. I don't think it's what I want. I need to have a conditional where if it's UNKNOWN it uses PAC-NA otherwise PAC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 05:58:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727969#M260880</guid>
      <dc:creator>drjoffily</dc:creator>
      <dc:date>2014-10-15T05:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727970#M260881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://community.qlikview.com/docs/DOC-1290" title="http://community.qlikview.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and D... | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 08:13:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727970#M260881</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-10-15T08:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727971#M260882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks tresesco.&lt;/P&gt;&lt;P&gt;Nevertheless, how would you write your syntax to have a variable calling another variable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 22:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727971#M260882</guid>
      <dc:creator>drjoffily</dc:creator>
      <dc:date>2014-10-15T22:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727972#M260883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having attachment issue since yesterday(getting the options right, but after pressing on 'Save Reply'/'Insert', it goes nowhere ). &lt;A href="https://community.qlik.com/qlik-users/59295"&gt;Sara Leslie&lt;/A&gt;, could you please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcos,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;vSum&lt;/EM&gt;&lt;/STRONG&gt; -&amp;gt; Sum(Amount)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;vvCondSum&lt;/STRONG&gt;&lt;/EM&gt; -&amp;gt; If(&lt;STRONG&gt;$(vSum)&amp;gt;&lt;/STRONG&gt;100, 'More than one hundred', '&amp;lt;= one hundred')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this blog too: &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables"&gt;&lt;EM&gt;the-magic-of-variables&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 04:57:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727972#M260883</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-10-16T04:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable inside another variable not working</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727973#M260884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marcos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the below attachment. I have created a sample application for the requirement you have requested for. This might help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2017 10:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-inside-another-variable-not-working/m-p/727973#M260884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-30T10:41:51Z</dc:date>
    </item>
  </channel>
</rss>

