<?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 Conditional selection by comparing month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-selection-by-comparing-month/m-p/276723#M496123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice. For "Type=A" I want to get sum "Value" if previous month "Direction=S" and current month "Direction=W". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month,Direction,Value,Type&lt;/P&gt;&lt;P&gt;Sep,N,1,B&lt;/P&gt;&lt;P&gt;Oct,W,2,B&lt;/P&gt;&lt;P&gt;Nov,S,3,A&lt;/P&gt;&lt;P&gt;Dec,W,4,A&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, 03 Dec 2011 16:47:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-03T16:47:09Z</dc:date>
    <item>
      <title>Conditional selection by comparing month</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-selection-by-comparing-month/m-p/276723#M496123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice. For "Type=A" I want to get sum "Value" if previous month "Direction=S" and current month "Direction=W". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month,Direction,Value,Type&lt;/P&gt;&lt;P&gt;Sep,N,1,B&lt;/P&gt;&lt;P&gt;Oct,W,2,B&lt;/P&gt;&lt;P&gt;Nov,S,3,A&lt;/P&gt;&lt;P&gt;Dec,W,4,A&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, 03 Dec 2011 16:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-selection-by-comparing-month/m-p/276723#M496123</guid>
      <dc:creator />
      <dc:date>2011-12-03T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Conditional selection by comparing month</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-selection-by-comparing-month/m-p/276724#M496124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a (e.g. straight) table chart object with above layout (dimensions Month, Direction, Type), you could probably use chart inter records like above() function in an expression to achieve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum( if(Type='A' and Direction='W' and above(Direction)='S', Value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to calculate this within a table chart e.g. in a global context, you could try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(aggr( sum( if(Type='A' and Direction='W' and above(Direction)='S', Value)), Month,Direction,Type) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately, you can't really control the sort order of a aggr() dimension, but you need Month to be sorted ascending (because above() should get the previous Month in correct order), like in your sample above (Sep, Oct, Nov, Dec). I believe this will work if this is your load order for field Month, but if not, that will be a possible issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 22:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-selection-by-comparing-month/m-p/276724#M496124</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-03T22:52:15Z</dc:date>
    </item>
  </channel>
</rss>

