<?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: Set Analysis with variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051274#M919969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax isn't quite correct. You could only filter/compare a field against a dataset and not against an expression. Therefore try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt; Year&amp;nbsp; = {"$(=max(Year))"} &amp;gt;} Revenue.Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this will be only work if these period-fields are numeric (you couldn't apply a calculation like max() or an comparison like &amp;lt;=&amp;gt; with string-values) and the dataset-format is abolutely identically with the field-format. This meant a match by month from April and 4 will fail within set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you haven't these fields as numeric fields within your datamodel I suggest to create them and use them within these calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 May 2016 07:12:04 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-05-01T07:12:04Z</dc:date>
    <item>
      <title>Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051272#M919964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to create a set that uses a variable vMaxYear, which is the maximum year. It continuously gives me an error and I can't seem to figure out why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to get Maximum year:&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Year([Year&amp;amp;Month]) = {$(=vMaxYear)}&amp;gt;}-Revenue.Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to get Previous year:&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Year([Year&amp;amp;Month])= {$(=vMaxYear)-1}&amp;gt;}-Revenue.Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051272#M919964</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051273#M919967</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;/P&gt;&lt;P&gt;Current&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Year = {"$(=vMaxYear)"}&amp;gt;} Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;Year = {"$(=vMaxYear)-1"}&amp;gt;} Revenue)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 07:08:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051273#M919967</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-05-01T07:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051274#M919969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax isn't quite correct. You could only filter/compare a field against a dataset and not against an expression. Therefore try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt; Year&amp;nbsp; = {"$(=max(Year))"} &amp;gt;} Revenue.Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this will be only work if these period-fields are numeric (you couldn't apply a calculation like max() or an comparison like &amp;lt;=&amp;gt; with string-values) and the dataset-format is abolutely identically with the field-format. This meant a match by month from April and 4 will fail within set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you haven't these fields as numeric fields within your datamodel I suggest to create them and use them within these calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 07:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051274#M919969</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-01T07:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051275#M919971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try Also &lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;YearOrderDateKey={"$(=vVariable-1)"}&amp;gt;} SalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;of course use your field at the Syntax &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 May 2016 08:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-variable/m-p/1051275#M919971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-01T08:53:02Z</dc:date>
    </item>
  </channel>
</rss>

