<?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 in Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162251#M35818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent - Thankyou Miguel.&lt;/P&gt;&lt;P&gt;Why does the quote start before the dollar ?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2011 16:51:57 GMT</pubDate>
    <dc:creator>darrellbutler</dc:creator>
    <dc:date>2011-03-15T16:51:57Z</dc:date>
    <item>
      <title>Variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162249#M35816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As a newbie can somebody point me in the right direction.&lt;/P&gt;&lt;P&gt;I have created the following variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;I&gt;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;LET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;vMaxMonthYr&lt;/I&gt; = Month(Today(0)) &amp;amp; '-' &amp;amp;right(year(Today(0)),4);&lt;/P&gt;&lt;P&gt;I then use this in a set expression:&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[MonthYear] = {&lt;B&gt;&lt;I&gt;$('vMaxMonthYr')&lt;/I&gt;&lt;/B&gt;}, [TYPE] = {"COLL"}, [COMPANY_CODE] = {"0017"} &amp;gt; } [VOL])/1000000&lt;/P&gt;&lt;P&gt;However, the sum calculation doesnt work.&lt;/P&gt;&lt;P&gt;MonthYear is derived from my master calendar and has been calculated using the same formula as the variable.&lt;/P&gt;&lt;P&gt;Any thoughts ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Darrell&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 16:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162249#M35816</guid>
      <dc:creator>darrellbutler</dc:creator>
      <dc:date>2011-03-15T16:41:41Z</dc:date>
    </item>
    <item>
      <title>Variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162250#M35817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Darrell,&lt;/P&gt;&lt;P&gt;You were almost there. Take a look at the quoting in the variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=sum({$&amp;lt;[MonthYear] = {'$(vMaxMonthYr)'}, [TYPE] = {'COLL'}, [COMPANY_CODE] = {'0017'} &amp;gt; } [VOL])/1000000&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 16:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162250#M35817</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-03-15T16:44:03Z</dc:date>
    </item>
    <item>
      <title>Variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162251#M35818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent - Thankyou Miguel.&lt;/P&gt;&lt;P&gt;Why does the quote start before the dollar ?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 16:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162251#M35818</guid>
      <dc:creator>darrellbutler</dc:creator>
      <dc:date>2011-03-15T16:51:57Z</dc:date>
    </item>
    <item>
      <title>Variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162252#M35819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In Set Analysis in particular there are three possible quotings&lt;/P&gt;&lt;P&gt;1.- When the value expected is numeric, no quoting: Sum({&amp;lt; ID = {1000} &amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;2.- When the value is a string (your case), single quoting: Sum({&amp;lt; Name = {'John'} &amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;3.- When the value requires search, double quoting: Sum({&amp;lt; CustomerID = {"AA*"} &amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;In your case, the field returns a literal (string), that it's not quoted within the variable. That's why you need single quoting before and after writing the variable.&lt;/P&gt;&lt;P&gt;Hope that makes sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 17:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Set-Analysis/m-p/162252#M35819</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-03-15T17:11:54Z</dc:date>
    </item>
  </channel>
</rss>

