<?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 Analysis and date ranges in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502569#M187769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting set modifiers in the max and min functions too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;= Sum ({1&amp;lt;[TranFlag] = {'3'}, [DateIN] = {&amp;lt;=$(=Max({1&amp;lt;Month=p(Month)&amp;gt;}DateNo))'}, [DateOUT] = {&amp;gt;=$(=Min({1&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;lt;Month=p(Month)&amp;gt;&lt;/STRONG&gt;}DateNo))'} &amp;gt;}&amp;nbsp; TransRecordNo)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2013 14:04:56 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-12-18T14:04:56Z</dc:date>
    <item>
      <title>Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502568#M187768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a very unusual problem/requirement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume I have 2 tables&lt;/P&gt;&lt;P&gt;CALENDAR&lt;/P&gt;&lt;P&gt;TRANSACTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;CALENDAR&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; table that has all the usual fields like &lt;EM&gt;Year, Quarter, Month, Day, DateNo, TranDate&lt;/EM&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;linked to a &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TRANSACTIONS&lt;/STRONG&gt; table that has columns like &lt;EM&gt;TranDate&lt;/EM&gt;, &lt;EM&gt;TranType&lt;/EM&gt;, &lt;EM&gt;Amount&lt;/EM&gt;, &lt;EM&gt;TranFlag, DateIN, DateOUT, TransRecordNo (this one is always 1) &lt;/EM&gt;etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user gets to select a date (or date range) and any number of other parameters from a Multi-select box (e.g TranType)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The application needs to calculate 2 things:&lt;/P&gt;&lt;P&gt;a) Total Amount for selections which is &lt;EM&gt;&lt;STRONG&gt;Sum(Amount)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;b) Total number of records that have TranFlag=3 for the period chosen and where the DateIN and DateOUT is in range of the selected date period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Sum ({1&amp;lt;[TranFlag] = {'3'}, [DateIN] = {&amp;lt;=$(=Max(DateNo))'}, [DateOUT] = {&amp;gt;=$(=Min(DateNo))'} &amp;gt;}&amp;nbsp; TransRecordNo)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you start off and select a month (say April 2014) then Min(DateNo) is 41365 (1st April 2013) and Max(DateNo) is 41394 (30th April) and the formula above works perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, however the user now selects TranType of 9 (say) from the multi-select and there are transactions of this type only for dates 5th, 7th and 11th April then:&lt;/P&gt;&lt;P&gt;Min(DateNo) is 41369 (5th April 2013) and Max(DateNo) is 41375 (11th April), so my formula above gives incorrect results because I am interested in the Number of records for the date range chosen (1st April until 30th) not the period that the "TranType" selection has resulted in. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way that I can resolve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502568#M187768</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2013-12-18T14:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502569#M187769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting set modifiers in the max and min functions too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;= Sum ({1&amp;lt;[TranFlag] = {'3'}, [DateIN] = {&amp;lt;=$(=Max({1&amp;lt;Month=p(Month)&amp;gt;}DateNo))'}, [DateOUT] = {&amp;gt;=$(=Min({1&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;lt;Month=p(Month)&amp;gt;&lt;/STRONG&gt;}DateNo))'} &amp;gt;}&amp;nbsp; TransRecordNo)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:04:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502569#M187769</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-18T14:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502570#M187770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A possibility is to create a secondary calendar not linked to the transaction table (a data island) and make your date selections in this table. Then refer to the data island in your set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:07:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502570#M187770</guid>
      <dc:creator />
      <dc:date>2013-12-18T14:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502571#M187771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a set expression to disregard all unwanted selections from your Max(DateNo) / Min(DateNo) like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Sum ({1&amp;lt;[TranFlag] = {'3'}, [DateIN] = {&amp;lt;=$(=Max({&amp;lt;TranType= &amp;gt;}DateNo))'}, [DateOUT] = {&amp;gt;=$(=Min(&lt;STRONG&gt;{&amp;lt;TranType= &amp;gt;}&lt;/STRONG&gt;DateNo))'} &amp;gt;}&amp;nbsp; TransRecordNo)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to disregard selections in TranType&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502571#M187771</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-12-18T14:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502572#M187772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert - thanks for replying&lt;/P&gt;&lt;P&gt;Your solution will not work as your will search at the ENTIRE set which is not what I am looking for in this instance.&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502572#M187772</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2013-12-18T14:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502573#M187773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting approach swuehl.&lt;/P&gt;&lt;P&gt;The above is a simplification of my app. In place of "TranType" I have another 6-7 fields.&lt;/P&gt;&lt;P&gt;I will give "Helpful" or "Answer" in a bit once I have had a chance to try it...&lt;/P&gt;&lt;P&gt;Thanx again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502573#M187773</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2013-12-18T14:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502574#M187774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks once again Swuehl.&lt;/P&gt;&lt;P&gt;What is the syntax if there were multiple fields that we were ignoring not just TranType&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 23:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502574#M187774</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2013-12-18T23:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and date ranges</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502575#M187775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;= Sum ({1&amp;lt;[TranFlag] = {'3'}, [DateIN] = {&amp;lt;=$(=Max({&amp;lt;TranType=, AnotherField=, YetAnotherField= &amp;gt;}DateNo))'}, [DateOUT] = {&amp;gt;=$(=Min(&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{&amp;lt;TranType=&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, AnotherField=, YetAnotherField=&lt;/STRONG&gt; &amp;gt;}&lt;/STRONG&gt;DateNo))'} &amp;gt;}&amp;nbsp; TransRecordNo)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 07:01:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-date-ranges/m-p/502575#M187775</guid>
      <dc:creator />
      <dc:date>2013-12-19T07:01:40Z</dc:date>
    </item>
  </channel>
</rss>

