<?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: only(Year)-1 in Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/only-Year-1-in-Expression/m-p/319063#M579610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if using two set expressions will work, like you do using two {$&amp;lt;...&amp;gt;}{&amp;lt;..&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume your first set expression is then just discarded, and you are not notice it if you select one year (because the first set expression will than just not change your set anyway).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try a set expression like&lt;/P&gt;&lt;P&gt;{$&amp;lt;Year={$(=only(Year))}, TD_FactTable.KOSTEN_ERLOES = {E} &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resp.&lt;/P&gt;&lt;P&gt;{$&amp;lt;Year={$(=only(Year)-1)}, TD_FactTable.KOSTEN_ERLOES = {E} &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: same set identifier used, so removed a comment on that..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Feb 2012 16:20:47 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-02-25T16:20:47Z</dc:date>
    <item>
      <title>only(Year)-1 in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/only-Year-1-in-Expression/m-p/319062#M579609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;=Sum({$&amp;lt;Year={$(=Only(Year))}&amp;gt;} {&amp;lt;TD_FactTable.KOSTEN_ERLOES = {'E'} &amp;gt;} distinct TD_FactTable.BETRAG)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt; Sum({$&amp;lt;Year={$(=Only(Year))}&amp;gt;} {&amp;lt;TD_FactTable.KOSTEN_ERLOES = {'K'} &amp;gt;} distinct TD_FactTable.BETRAG)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The above formula works perfectly in a Pivottable Expression. The below with Only(Year)-1 gives the same value as above expression with Only(Year)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Year={$(=Only(Year)-1)}&amp;gt;} {&amp;lt;TD_FactTable.KOSTEN_ERLOES = {'E'} &amp;gt;} distinct TD_FactTable.BETRAG)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt; Sum({$&amp;lt;Year={$(=Only(Year)-1)}&amp;gt;} {&amp;lt;TD_FactTable.KOSTEN_ERLOES = {'K'} &amp;gt;} distinct TD_FactTable.BETRAG)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems to be silly but I am not getting. May be some one can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sravan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Feb 2012 16:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/only-Year-1-in-Expression/m-p/319062#M579609</guid>
      <dc:creator />
      <dc:date>2012-02-25T16:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: only(Year)-1 in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/only-Year-1-in-Expression/m-p/319063#M579610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if using two set expressions will work, like you do using two {$&amp;lt;...&amp;gt;}{&amp;lt;..&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume your first set expression is then just discarded, and you are not notice it if you select one year (because the first set expression will than just not change your set anyway).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try a set expression like&lt;/P&gt;&lt;P&gt;{$&amp;lt;Year={$(=only(Year))}, TD_FactTable.KOSTEN_ERLOES = {E} &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resp.&lt;/P&gt;&lt;P&gt;{$&amp;lt;Year={$(=only(Year)-1)}, TD_FactTable.KOSTEN_ERLOES = {E} &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: same set identifier used, so removed a comment on that..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Feb 2012 16:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/only-Year-1-in-Expression/m-p/319063#M579610</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-25T16:20:47Z</dc:date>
    </item>
  </channel>
</rss>

