<?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 Set Analysis with 2 selections based on positive or negative value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186452#M500373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have problem with expression creation based on positive/negative values.&lt;/P&gt;&lt;P&gt;This is example data:&lt;/P&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/5857.Data_5F00_Example.xls:550:0]&lt;/P&gt;&lt;P&gt;Result should be like this:&lt;BR /&gt;Article age based on selected date: &lt;STRONG&gt;15.07.2000&lt;/STRONG&gt; (from Master Calendar)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Article Age:&lt;/STRONG&gt;&lt;BR /&gt;Article | 0-4 months | 4-8 months&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;X | 200 | 500&lt;BR /&gt;Y | 0 | 1000&lt;BR /&gt;Z | 500 | 0&lt;BR /&gt;-------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Expressions should be created for "1-3 months" and "3-8 months" in a way that it sums all positive values depending on defined timeframe ("3-8 months" for example) and deduct all negative numbers earlier then Selected Date, all based on ID entry. If multiple IDs fall into same timeframe, they are summed.&lt;/P&gt;&lt;P&gt;My idea was to use Set Analysis system with 2 selections for same column, based on positive or negative values.&lt;/P&gt;&lt;P&gt;Tnx for ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Mar 2011 09:21:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-29T09:21:32Z</dc:date>
    <item>
      <title>Set Analysis with 2 selections based on positive or negative value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186452#M500373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have problem with expression creation based on positive/negative values.&lt;/P&gt;&lt;P&gt;This is example data:&lt;/P&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/5857.Data_5F00_Example.xls:550:0]&lt;/P&gt;&lt;P&gt;Result should be like this:&lt;BR /&gt;Article age based on selected date: &lt;STRONG&gt;15.07.2000&lt;/STRONG&gt; (from Master Calendar)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Article Age:&lt;/STRONG&gt;&lt;BR /&gt;Article | 0-4 months | 4-8 months&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;X | 200 | 500&lt;BR /&gt;Y | 0 | 1000&lt;BR /&gt;Z | 500 | 0&lt;BR /&gt;-------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Expressions should be created for "1-3 months" and "3-8 months" in a way that it sums all positive values depending on defined timeframe ("3-8 months" for example) and deduct all negative numbers earlier then Selected Date, all based on ID entry. If multiple IDs fall into same timeframe, they are summed.&lt;/P&gt;&lt;P&gt;My idea was to use Set Analysis system with 2 selections for same column, based on positive or negative values.&lt;/P&gt;&lt;P&gt;Tnx for ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 09:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186452#M500373</guid>
      <dc:creator />
      <dc:date>2011-03-29T09:21:32Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with 2 selections based on positive or negative value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186453#M500374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use a calculated dimension for your date ranges:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(Date&amp;lt;vDate, Replace(Class((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date)) , 4), '&amp;lt;= x &amp;lt;', 'to') &amp;amp; ' months')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(This excludes dates greater than your selected date = vDate)&lt;/P&gt;&lt;P&gt;Positive values, use RangeMax:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(RangeMax(0, QTY))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Negs, use RangeMin - though you might want this set if you choose to not exclude the forward dates in the calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Date={"&amp;lt;$(=Date(vDate))"}&amp;gt;} RangeMin(0, QTY))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 10:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186453#M500374</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2011-03-29T10:00:36Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with 2 selections based on positive or negative value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186454#M500375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had an error in explanation for what is needed .... instead "1-3 months" it should be 0-4 and for 3-8 it should be 4-8 (like in table).&lt;/P&gt;&lt;P&gt;Tnx for tips, now i'm trying to implement this in my table. It is not so simple as my original table is defined with many periods ( 0-1, 1-2, 2-3, 3-6, 6-12, 12-24, 24-36 and 36+ months). It is used for calculation of quantites (and later on values) per article based on FIFO method, hence different IDs for same Article (warehouse entry tracking).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 11:45:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186454#M500375</guid>
      <dc:creator />
      <dc:date>2011-03-29T11:45:20Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with 2 selections based on positive or negative value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186455#M500376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the ranges you want with a nested if like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 0, Dual('Future', '0'),&lt;BR /&gt;if(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 2, Dual('0-1', 1),&lt;BR /&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 4, Dual('2-3', 3),&lt;BR /&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 7, Dual('4-6', 6),&lt;BR /&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 13, Dual('7-12', 12),&lt;BR /&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 25, Dual('13-24', 24),&lt;BR /&gt;If(((year(vDate)*12 + Month(vDate)) - (year(Date)*12 + Month(Date))) &amp;lt; 37, Dual('25-36', 25),&lt;BR /&gt;Dual('36+', 36))))))))&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 15:53:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-2-selections-based-on-positive-or-negative/m-p/186455#M500376</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2011-03-29T15:53:01Z</dc:date>
    </item>
  </channel>
</rss>

