<?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/471976#M176249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to use a variable in a set analysis expression and I can't figure out the syntax.&amp;nbsp; It currently looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13540506097293178" jivemacro_uid="_13540506097293178"&gt;&lt;P&gt;SUM({$&amp;lt;TIME_Year={vMax_Year}&amp;gt;} Employee_Salary)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'vMax_Year' is a variable set to the latest year in my data (2012).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2012 21:20:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-11-27T21:20:24Z</dc:date>
    <item>
      <title>Variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471976#M176249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to use a variable in a set analysis expression and I can't figure out the syntax.&amp;nbsp; It currently looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13540506097293178" jivemacro_uid="_13540506097293178"&gt;&lt;P&gt;SUM({$&amp;lt;TIME_Year={vMax_Year}&amp;gt;} Employee_Salary)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'vMax_Year' is a variable set to the latest year in my data (2012).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 21:20:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471976#M176249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-27T21:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471977#M176250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;CODE class="jive-code"&gt;SUM({$&amp;lt;TIME_Year={$(#vMax_Year}&amp;gt;} Employee_Salary)&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Thanks,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Dan&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 21:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471977#M176250</guid>
      <dc:creator>dwh1104</dc:creator>
      <dc:date>2012-11-27T21:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471978#M176251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan, but it didn't work.&amp;nbsp; However I did get it to work with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;TIME_Year={"$(vMax_Year)"}&amp;gt;} Employee_Salary)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me understand why?&amp;nbsp; Do you know of a good resource for set analysis syntax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 21:33:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471978#M176251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-27T21:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471979#M176252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you were trying to run your expression without the dollar sign you were effectively mixing syntaxes.&amp;nbsp; Use of the variable at that point was not valid.&amp;nbsp; However, when you put a variable in $() what QlikView does is 'swaps out' the dollar sign expanded variable for it's contents.&amp;nbsp; This would mean that your code would effectively read as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;TIME_Year={"2012"}&amp;gt;} Employee_Salary)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is then valid syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of PDF files on Set Analysis that you should be able to find if you Google for them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've uploaded a couple of Set Analysis examples as 'Shared QlikViews' that may be of help:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1175" title="http://community.qlik.com/qlikviews/1175"&gt;http://community.qlik.com/qlikviews/1175&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1113" title="http://community.qlik.com/qlikviews/1113"&gt;http://community.qlik.com/qlikviews/1113&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.quickintelligence.co.uk/steve-dark/"&gt;Steve&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 00:04:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-set-analysis/m-p/471979#M176252</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2012-11-28T00:04:25Z</dc:date>
    </item>
  </channel>
</rss>

