<?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 Date comparisons with sum - Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229317#M81250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Conor,&lt;/P&gt;&lt;P&gt;First, make sure that the field [BSID90.Posting Date_BUDAT] has the same date value that the one returned by Date() function over your MonthYear90 and MonthEnd-90.&lt;/P&gt;&lt;P&gt;Second, you may need to do a bit more trasnformation to get proper formatted dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;MonthEnd(Date(Date#(MonthYear90, 'MMM-YY')))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;will return something like "30/06/2009". So you will get a final expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; [BSID90.Posting Date_BUDAT] = {"&amp;gt;=$(=date([MonthEnd-90]))&amp;lt;=$(=MonthEnd(Date(Date#(MonthYear90, 'MMM-YY')))"} &amp;gt;} BSID90.Amount_WRBTR * [BSID90.BSID Debit/Credit_FLAG])&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Besides, you can &lt;A href="http://community.qlik.com/forums/p/22821/87243.aspx" target="_blank" title="How to make a calendar?"&gt;create a master calendar&lt;/A&gt; where you get one record per date field (say Posting Date), with as many fields as you need, for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;AddMonths(MonthEnd([Posting Date]), -3) AS CompleteDate-90,Date(AddMonths(MonthEnd([Posting Date]), -3), 'MMM-YY') AS MonthYear-90&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;as well as any other dimension you will use in your charts.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Oct 2010 10:55:05 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-10-06T10:55:05Z</dc:date>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229316#M81249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could someone tell me what is wrong with the expression below? I keep getting nothing coming out. When I create list boxes and charts I can get the correct information out but when I try to replicate my selections in an expression, it doesn't work.&lt;/P&gt;&lt;P&gt;MonthYear90 gives a value like Jan-09, Feb-09, Mar-09, etc... and MonthEnd-90 is a field displaying 90 days before the end of the current month.&lt;/P&gt;&lt;P&gt;The calculation should bring back the sum of the amount where Posting Date &amp;lt;= last day of current month and Document Date &amp;gt;= 90 days before the end of the current month.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Conor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; [BSID90.Posting Date_BUDAT] = {"&amp;lt;=$ (=date(MonthEnd(MonthYear90)))"}, [BSID90.Document Date_BLDAT] = {"&amp;gt;= (=date([MonthEnd-90]))"} &amp;gt;} BSID90.Amount_WRBTR * [BSID90.BSID Debit/Credit_FLAG])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:41:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229316#M81249</guid>
      <dc:creator />
      <dc:date>2010-10-06T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229317#M81250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Conor,&lt;/P&gt;&lt;P&gt;First, make sure that the field [BSID90.Posting Date_BUDAT] has the same date value that the one returned by Date() function over your MonthYear90 and MonthEnd-90.&lt;/P&gt;&lt;P&gt;Second, you may need to do a bit more trasnformation to get proper formatted dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;MonthEnd(Date(Date#(MonthYear90, 'MMM-YY')))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;will return something like "30/06/2009". So you will get a final expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; [BSID90.Posting Date_BUDAT] = {"&amp;gt;=$(=date([MonthEnd-90]))&amp;lt;=$(=MonthEnd(Date(Date#(MonthYear90, 'MMM-YY')))"} &amp;gt;} BSID90.Amount_WRBTR * [BSID90.BSID Debit/Credit_FLAG])&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Besides, you can &lt;A href="http://community.qlik.com/forums/p/22821/87243.aspx" target="_blank" title="How to make a calendar?"&gt;create a master calendar&lt;/A&gt; where you get one record per date field (say Posting Date), with as many fields as you need, for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;AddMonths(MonthEnd([Posting Date]), -3) AS CompleteDate-90,Date(AddMonths(MonthEnd([Posting Date]), -3), 'MMM-YY') AS MonthYear-90&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;as well as any other dimension you will use in your charts.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229317#M81250</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-06T10:55:05Z</dc:date>
    </item>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229318#M81251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Thanks for getting back so quickly. I checked that all the dates are in the same format - they are.&lt;/P&gt;&lt;P&gt;Here is my new code but it is bringing back zero amounts:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; [BSID90.Posting Date_BUDAT] = {"&amp;lt;=$(=MonthEnd(Date(Date#(MonthYear90, 'MMM-YY'))))"}, [BSID90.Document Date_BLDAT] = {"&amp;gt;=$(=date(monthend(MonthYear90) - 90))"} &amp;gt;} BSID90.Amount_WRBTR * [BSID90.BSID Debit/Credit_FLAG])&lt;/P&gt;&lt;P&gt;As you can see from the screenshot it doesn't seem to be looking at anything when comparing the Posting and Document dates. any ideas?&lt;/P&gt;&lt;P&gt;Conor&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/1362.code.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/1362.code.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 11:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229318#M81251</guid>
      <dc:creator />
      <dc:date>2010-10-06T11:52:27Z</dc:date>
    </item>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229319#M81252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As an idea, try those expressions in a text object, select a date and see what results are displayed in it. It's not evaluating the MonthEnd() nor the date() expressions, so you first need to check that both functions return the right values.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 12:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229319#M81252</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-06T12:05:27Z</dc:date>
    </item>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229320#M81253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel,&lt;/P&gt;&lt;P&gt;When you select only one value for MonthYear90 (eg: Aug-09) it works and displays the correct values in text boxes and in the chart. But when there is more than one value selected or when there are none it displays zeroes.&lt;/P&gt;&lt;P&gt;So how do I get the chart to display all values?&lt;/P&gt;&lt;P&gt;Conor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 13:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229320#M81253</guid>
      <dc:creator />
      <dc:date>2010-10-06T13:29:03Z</dc:date>
    </item>
    <item>
      <title>Date comparisons with sum - Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229321#M81254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check the Always one selected value on the date field you're using.&lt;/P&gt;&lt;P&gt;Or instead of doing a set analysis using Min or Max of your MonthYear90&lt;/P&gt;&lt;P&gt;As an example "&amp;lt;=$(=Max(MonthEnd(Date(Date#(MonthYear90,'MMM-YY')))))"&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 14:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-comparisons-with-sum-Set-analysis/m-p/229321#M81254</guid>
      <dc:creator />
      <dc:date>2010-10-06T14:26:21Z</dc:date>
    </item>
  </channel>
</rss>

