<?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: Is it possible.... by using set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322209#M118687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd make script changes.&amp;nbsp; But if that's not allowed, here's a way to do what frankrezee was suggesting without hardcoding the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;$(=concat(distinct 'if(YEAR=' &amp;amp; YEAR &amp;amp; ',sum({&amp;lt;YEAR={' &amp;amp; (YEAR-1) &amp;amp; '}&amp;gt;} total SALES)',',',YEAR)&amp;amp;repeat(')',count(distinct YEAR)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2011 21:30:43 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-12-27T21:30:43Z</dc:date>
    <item>
      <title>Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322204#M118682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMPORTANT: I have attached an example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really sorry because in these days I am bothering the community with Set analysis problems.... but then again is it possible to obtain this table: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;YEAR&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;SALES&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;SALES (YEAR- 1)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2009&lt;/TD&gt;&lt;TD&gt;754&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2010&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;754&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2011&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to obtain the previous values without modify the script (and WITHOUT using above or before)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2011 13:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322204#M118682</guid>
      <dc:creator />
      <dc:date>2011-12-23T13:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322205#M118683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't think of a way to do it without changing the script. &lt;/P&gt;&lt;P&gt;If you can change the script a bit, an easy method would be to create another table which doesn't link to your data source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Years:&lt;/P&gt;&lt;P&gt;Load Distinct Year as Year2&lt;/P&gt;&lt;P&gt;resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, in your chart, use Year2 as your dimension, and use the following expressions:&lt;/P&gt;&lt;P&gt;sum(if(Year=Year2,Sales))&lt;/P&gt;&lt;P&gt;sum(if(Year=Year2-1,Sales))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2011 15:19:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322205#M118683</guid>
      <dc:creator>danielact</dc:creator>
      <dc:date>2011-12-23T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322206#M118684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Danielact, at the end I think this is the only way .... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322206#M118684</guid>
      <dc:creator />
      <dc:date>2011-12-23T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322207#M118685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try this: &lt;/P&gt;&lt;P&gt;if(YEAR=2010,sum(total{$&amp;lt;YEAR={2009}&amp;gt;}SALES),if(YEAR=2011,sum(total{$&amp;lt;YEAR={2010}&amp;gt;}SALES)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322207#M118685</guid>
      <dc:creator />
      <dc:date>2011-12-23T16:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322208#M118686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would also prefer using a small script change, or above(), but since you don't want this, you could do the same like suggested by danielact with an synthetic dimension. Please see attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you want to learn how to do this with set analysis. Well, the set expression is evaluated once per chart, so you can't request the actual dimension value YEAR for a row and use it in your set expression.&lt;/P&gt;&lt;P&gt;You can create set expressions for each year, though and get the same results, but you lose the flexibilty (if you add more YEARs, this chart won't reflect it automatically).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2011 16:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322208#M118686</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-23T16:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible.... by using set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322209#M118687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd make script changes.&amp;nbsp; But if that's not allowed, here's a way to do what frankrezee was suggesting without hardcoding the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;$(=concat(distinct 'if(YEAR=' &amp;amp; YEAR &amp;amp; ',sum({&amp;lt;YEAR={' &amp;amp; (YEAR-1) &amp;amp; '}&amp;gt;} total SALES)',',',YEAR)&amp;amp;repeat(')',count(distinct YEAR)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 21:30:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Is-it-possible-by-using-set-analysis/m-p/322209#M118687</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-12-27T21:30:43Z</dc:date>
    </item>
  </channel>
</rss>

