<?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 Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589438#M218585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the case is clear for you. Now you should write the same logic using set analysis syntax. Keep R_Month selection (so you can skip it in expression) and keep only those To_Month where To_Month&amp;lt;&amp;gt; R_Month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;sum( {$&amp;lt;[R_YEAR] = {'$(=max([R_YEAR]))'}, [To_MONTH]={'=[To_MONTH]&amp;lt;&amp;gt;[R_MONTH]'} ,POL_TYPE={'F'}&amp;gt;} [PREMIUM] ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Feb 2014 18:55:25 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2014-02-15T18:55:25Z</dc:date>
    <item>
      <title>Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589436#M218583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( {$&amp;lt;[R_YEAR] = {'$(=max([R_YEAR]))'},[R_MONTH]-={'$(=max([To_MONTH]))'},POL_TYPE={'F'}&amp;gt;} [PREMIUM] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the above expression in the attached file and it is working, But I want to exclude the following records only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the use select R_Year as 2013 and R_Month as Jan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show only&amp;nbsp; records where To_Month&amp;lt;&amp;gt; R_Month (R_Month=Jan and To_month= any month other than Jan)&lt;/P&gt;&lt;P&gt;In other words 1st 11 records shown in my my pivot table(attached) should be excluded and all other records must remain as it is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to rewrite the&amp;nbsp; expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 05:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589436#M218583</guid>
      <dc:creator>upaliwije</dc:creator>
      <dc:date>2014-02-15T05:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589437#M218584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems, you can solve this problem by using the variables. Follow the below steps.&lt;/P&gt;&lt;P&gt;1. Create variable vVar1 and assign ',' as text (Don't use = sign to assing this text).&lt;/P&gt;&lt;P&gt;2. Create another variable vVar2 and assing string as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =chr(39) &amp;amp; Replace(GetFieldSelections(R_MONTH), ', ',vVar2) &amp;amp; chr(39)&lt;/P&gt;&lt;P&gt;3. Change your set expression as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =sum( {$&amp;lt;[R_YEAR] = {'$(=max([R_YEAR]))'},[R_MONTH]-={'$(=max([To_MONTH]))'}, [To_MONTH] -= {$(vVar2)}, POL_TYPE={'F'}&amp;gt;} [PREMIUM] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably you may get better solution than this from our folks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 08:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589437#M218584</guid>
      <dc:creator />
      <dc:date>2014-02-15T08:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589438#M218585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the case is clear for you. Now you should write the same logic using set analysis syntax. Keep R_Month selection (so you can skip it in expression) and keep only those To_Month where To_Month&amp;lt;&amp;gt; R_Month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;sum( {$&amp;lt;[R_YEAR] = {'$(=max([R_YEAR]))'}, [To_MONTH]={'=[To_MONTH]&amp;lt;&amp;gt;[R_MONTH]'} ,POL_TYPE={'F'}&amp;gt;} [PREMIUM] ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 18:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression/m-p/589438#M218585</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-02-15T18:55:25Z</dc:date>
    </item>
  </channel>
</rss>

