<?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 Problem with set modifier with embedded calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279530#M852085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to QlikView and I'm having difficulty in getting my expression to give me the correct value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having problems with the set modifier below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14882765444648685 jive_text_macro" jivemacro_uid="_14882765444648685" modifiedtitle="true"&gt;
&lt;P&gt;//Works 100% - just a bit slow&lt;/P&gt;
&lt;P&gt;sum({1} If([YearMonth]&amp;lt;= $(=date(addmonths(makedate(Year,Month),0),'YYYYMM')) and [YearMonth]&amp;gt; $(=date(addmonths(makedate(Year,Month),-12),'YYYYMM')) and [Account Code] &amp;gt;= 5000 and [Account Code] &amp;lt;= 6010 and [Acc Advisor Code] &amp;lt;&amp;gt; '#0000' and [Acc Advisor Code] &amp;lt;&amp;gt; '#', Amount*_ActualInd))&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Works 100%&lt;/P&gt;
&lt;P&gt;sum({1 &amp;lt; [YearMonth] = {"&amp;gt;201512&amp;lt;=201612"}, [Account Code] = {"&amp;gt;=5000&amp;lt;=6010"}, [Acc Advisor Code] -= {'#0000', '#'} &amp;gt;} Amount*_ActualInd)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Gives me ZERO values&lt;/P&gt;
&lt;P&gt;sum({1 &amp;lt; [YearMonth] = {$(= "&amp;gt;" &amp;amp; date(addmonths(makedate(Year,Month),-12),'YYYYMM') &amp;amp; "&amp;lt;=" &amp;amp; date(addmonths(makedate(Year,Month),0),'YYYYMM'))}, [Account Code] = {"&amp;gt;=5000&amp;lt;=6010"}, [Acc Advisor Code] -= {'#0000', '#'} &amp;gt;} Amount*_ActualInd)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for anyone that can help me in the right direction!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>pjn123pjn123</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Problem with set modifier with embedded calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279530#M852085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to QlikView and I'm having difficulty in getting my expression to give me the correct value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having problems with the set modifier below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14882765444648685 jive_text_macro" jivemacro_uid="_14882765444648685" modifiedtitle="true"&gt;
&lt;P&gt;//Works 100% - just a bit slow&lt;/P&gt;
&lt;P&gt;sum({1} If([YearMonth]&amp;lt;= $(=date(addmonths(makedate(Year,Month),0),'YYYYMM')) and [YearMonth]&amp;gt; $(=date(addmonths(makedate(Year,Month),-12),'YYYYMM')) and [Account Code] &amp;gt;= 5000 and [Account Code] &amp;lt;= 6010 and [Acc Advisor Code] &amp;lt;&amp;gt; '#0000' and [Acc Advisor Code] &amp;lt;&amp;gt; '#', Amount*_ActualInd))&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Works 100%&lt;/P&gt;
&lt;P&gt;sum({1 &amp;lt; [YearMonth] = {"&amp;gt;201512&amp;lt;=201612"}, [Account Code] = {"&amp;gt;=5000&amp;lt;=6010"}, [Acc Advisor Code] -= {'#0000', '#'} &amp;gt;} Amount*_ActualInd)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Gives me ZERO values&lt;/P&gt;
&lt;P&gt;sum({1 &amp;lt; [YearMonth] = {$(= "&amp;gt;" &amp;amp; date(addmonths(makedate(Year,Month),-12),'YYYYMM') &amp;amp; "&amp;lt;=" &amp;amp; date(addmonths(makedate(Year,Month),0),'YYYYMM'))}, [Account Code] = {"&amp;gt;=5000&amp;lt;=6010"}, [Acc Advisor Code] -= {'#0000', '#'} &amp;gt;} Amount*_ActualInd)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for anyone that can help me in the right direction!&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/Problem-with-set-modifier-with-embedded-calculation/m-p/1279530#M852085</guid>
      <dc:creator>pjn123pjn123</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with set modifier with embedded calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279531#M852086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&lt;SPAN class="number"&gt;1 &amp;lt; [YearMonth] = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;{"&amp;gt;$(=date(addmonths(makedate(Year,Month),-&lt;SPAN class="number"&gt;12&lt;/SPAN&gt;),&lt;SPAN class="string"&gt;'YYYYMM'&lt;/SPAN&gt;))&lt;SPAN class="string"&gt;&amp;lt;=$(=&lt;/SPAN&gt;date(addmonths(makedate(Year,Month),&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;),&lt;SPAN class="string"&gt;'YYYYMM'&lt;/SPAN&gt;))"}, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;[Account Code] = {&lt;SPAN class="string"&gt;"&amp;gt;=5000&amp;lt;=6010"&lt;/SPAN&gt;}, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;[Acc Advisor Code] -= {&lt;SPAN class="string"&gt;'#0000'&lt;/SPAN&gt;, &lt;SPAN class="string"&gt;'#'&lt;/SPAN&gt;} &amp;gt;} Amount*_ActualInd)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="number"&gt;- Marcus&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 10:58:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279531#M852086</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-02-28T10:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with set modifier with embedded calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279532#M852087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was a quick fix! Thanks for the help Marcus!&lt;/P&gt;&lt;P&gt;The code now returns the last 12 month figures as expected. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 12:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-set-modifier-with-embedded-calculation/m-p/1279532#M852087</guid>
      <dc:creator>pjn123pjn123</dc:creator>
      <dc:date>2017-02-28T12:17:49Z</dc:date>
    </item>
  </channel>
</rss>

