<?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:Using set analysis with variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145474#M505574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nigel,&lt;/P&gt;&lt;P&gt;What do you mean?&lt;/P&gt;&lt;P&gt;Something like below?&lt;/P&gt;&lt;P&gt;set vValue = '=Sum($&amp;lt;[Concept] = {'RESULTADO'} , [Month] = {'$(=MaxString([AuxMonth]))'}&amp;gt;ValueEUR)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jun 2009 19:48:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-01T19:48:09Z</dc:date>
    <item>
      <title>Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145469#M505566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a table &lt;STRONG&gt;Fact&lt;/STRONG&gt;: Concept, Month, ValueEUR&lt;/P&gt;&lt;P&gt;And another table &lt;STRONG&gt;AuxTime&lt;/STRONG&gt;: AuxMonth&lt;/P&gt;&lt;P&gt;I use the set analysis expression below:&lt;/P&gt;&lt;P&gt;Sum($&amp;lt;[Concept] = {'RESULTADO'} , [Month] = {'$(=MaxString([AuxMonth]))'}&amp;gt;ValueEUR)&lt;/P&gt;&lt;P&gt;If I use this expression directly in a Chart, the expression works right. However, if I create a variable and then I use the variable in the Chart, it doesn't work. The expression becomes&lt;/P&gt;&lt;P&gt;Sum($&amp;lt;[Concept] = {'RESULTADO'} , [Month] = {''}&amp;gt;ValueEUR)&lt;/P&gt;&lt;P&gt;What I do wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 17:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145469#M505566</guid>
      <dc:creator />
      <dc:date>2009-05-29T17:09:19Z</dc:date>
    </item>
    <item>
      <title>Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145470#M505570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More information:&lt;/P&gt;&lt;P&gt;If I create the variable in the script as:&lt;/P&gt;&lt;P&gt;set vValue = Sum($&amp;lt;[Concept] = {'RESULTADO'} , [Month] = {'$(=MaxString([AuxMonth]))'}&amp;gt;ValueEUR)&lt;/P&gt;&lt;P&gt;it doesn't work.&lt;/P&gt;&lt;P&gt;However, if I go to the "pannel variable" and I create there the variable, the expresion goes right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 18:20:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145470#M505570</guid>
      <dc:creator />
      <dc:date>2009-05-29T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145471#M505571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It isn't working because QlikView is doing the dollar sign expansion when you set the variable rather than waiting until it is used. I remember that fixing it is something trivial, like putting the whole expression in quotes, but I don't think that was it, and I haven't done it myself so I don't have anything to look up. Hopefully someone that's actually done it will let us know. And at least you have a workaround.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 23:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145471#M505571</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-29T23:06:27Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145472#M505572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John for your answer. I'll try to find out the way to declare this variable in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 15:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145472#M505572</guid>
      <dc:creator />
      <dc:date>2009-06-01T15:31:21Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145473#M505573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I think you need to put an EQUAL sign at the front of the expression in the variable.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nigel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 17:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145473#M505573</guid>
      <dc:creator />
      <dc:date>2009-06-01T17:50:46Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145474#M505574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nigel,&lt;/P&gt;&lt;P&gt;What do you mean?&lt;/P&gt;&lt;P&gt;Something like below?&lt;/P&gt;&lt;P&gt;set vValue = '=Sum($&amp;lt;[Concept] = {'RESULTADO'} , [Month] = {'$(=MaxString([AuxMonth]))'}&amp;gt;ValueEUR)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 19:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145474#M505574</guid>
      <dc:creator />
      <dc:date>2009-06-01T19:48:09Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145475#M505575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kim&lt;/P&gt;&lt;P&gt;Yes, that's exactly what I mean.&lt;/P&gt;&lt;P&gt;Nigel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 19:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145475#M505575</guid>
      <dc:creator />
      <dc:date>2009-06-01T19:50:02Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145476#M505576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nigel,&lt;/P&gt;&lt;P&gt;I have tried it, but it doesn't work.&lt;/P&gt;&lt;P&gt;Look the file attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 20:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145476#M505576</guid>
      <dc:creator />
      <dc:date>2009-06-01T20:04:47Z</dc:date>
    </item>
    <item>
      <title>Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145477#M505577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, I think you need to use LET instead of SET.&lt;/P&gt;&lt;P&gt;Then, you need to concatenate the string in order to make it come out how you want. This worked for me:&lt;/P&gt;&lt;P&gt;LET vSumaScript2 = '=Sum({$&amp;lt;Concept = {RESULTADO} , Month = {' &amp;amp; '$' &amp;amp; '(=MaxString([AuxMonth]))}&amp;gt;} Value)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145477#M505577</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:11:30Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145478#M505578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kim&lt;/P&gt;&lt;P&gt;Yes, sorry about that, its not quite as simple as I first thought.&lt;/P&gt;&lt;P&gt;The thing is that when you set a variable that uses dollar expansion, QlikView immediately expands the dollar expansion part and sets the variable according to the value. If the value doesn't exist then it simply creates an expression that states something like Month = {""} in the middle of your set analysis expression.&lt;/P&gt;&lt;P&gt;I have come across the problem before and I worked around it by creating a variable that held (for example) your definition of =MaxString([AuxMonth]), then, in the load script you would set you variable to be something like Month = {"$(MaxMonth)"} where MaxMonth holds the above value.&lt;/P&gt;&lt;P&gt;I've been playing around with this for a while, but haven't got the final answer yet (but I need to do some work now).&lt;/P&gt;&lt;P&gt;I would attach something, but I can't firgure out how to attach anything to this message!!!&lt;/P&gt;&lt;P&gt;Nigel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145478#M505578</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:20:18Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145479#M505579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, ignore all of my ramblings, although my solution worked for me before the answer above from NMiller is a MUCH better solution, I've just tried it and it works perfectly (and I'll now use that in my own apps).&lt;/P&gt;&lt;P&gt;Cheers all,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145479#M505579</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145480#M505580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure that an intermediate variable will work. I tried it, but QlikView seemed to expand the variable and then expand the value of that variable and I ended up with the same blank spot in the formula.&lt;/P&gt;&lt;P&gt;To attach a document, click the Options tab at the top of the post page. Choose Add/Update Attachment and choose your file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145480#M505580</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re:Using set analysis with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145481#M505581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all,&lt;/P&gt;&lt;P&gt;Till now, the best solution is the NMiller one's.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 22:05:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-with-variables/m-p/145481#M505581</guid>
      <dc:creator />
      <dc:date>2009-06-01T22:05:49Z</dc:date>
    </item>
  </channel>
</rss>

