<?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 Previous MTD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327335#M120498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this expression that works for the whole month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{$&amp;lt;Month={$(=Only(Month))}&amp;gt;} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much nicer syntax!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doesn't solve my problem...&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to build up the dates with concatenation?&amp;nbsp; Is there a nice way to determine what the expression is returning?&amp;nbsp; I'm finding debugging to be quite difficult.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Dec 2011 23:50:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-28T23:50:53Z</dc:date>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327334#M120497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an expression that will limit values to the previous month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&amp;lt;Date = {"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;$(=monthstart(today()))"}, Month= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like is to modify the 'less than' portion to give me month-to-date for the previous month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 23:13:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327334#M120497</guid>
      <dc:creator />
      <dc:date>2011-12-28T23:13:08Z</dc:date>
    </item>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327335#M120498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this expression that works for the whole month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{$&amp;lt;Month={$(=Only(Month))}&amp;gt;} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much nicer syntax!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doesn't solve my problem...&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to build up the dates with concatenation?&amp;nbsp; Is there a nice way to determine what the expression is returning?&amp;nbsp; I'm finding debugging to be quite difficult.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 23:50:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327335#M120498</guid>
      <dc:creator />
      <dc:date>2011-12-28T23:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327336#M120499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what you mean by building up dates with concatenation, but you could concatenate a list of dates and then insert them into set analysis.&amp;nbsp; The below set does nothing, but should give an idea of syntax, assuming I got the syntax right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{&amp;lt;Date={$(=concat(distinct chr(39) &amp;amp; Date &amp;amp; chr(39),','))}&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For debugging set analysis, make a chart that has your set analysis expression as the first chart expression, but do NOT label the expression, and do NOT supply a caption for the chart.&amp;nbsp; The caption and column heading will then show your expression.&amp;nbsp; One of them (I forget which) shows the expression just like you wrote it.&amp;nbsp; One of them shows it after the dollar sign substitution has taken place.&amp;nbsp; Comparing the two will very often let you know what's going wrong, or at least WHERE it is going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; As far as your original question goes, if I understood it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{&amp;lt;Date={"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;=$(=addmonths(today(),-1))"},Month=&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 23:59:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327336#M120499</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-12-28T23:59:21Z</dc:date>
    </item>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327337#M120500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like the debugging idea!&amp;nbsp; I don't rename the column when debugging, but I didn't realize the caption could help.&amp;nbsp; My concatenation idea was to make up the date for the previous month with the same day as today.&amp;nbsp; But the year will be a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My pseudocode for my attempts is something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier;"&gt;{&amp;lt;Date={"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;=&amp;nbsp; &lt;STRONG&gt;make a date from today() minus 30&lt;/STRONG&gt;&amp;nbsp; ))"},Month=&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll keep slugging away unless someone steers me in a better direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 00:36:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327337#M120500</guid>
      <dc:creator />
      <dc:date>2011-12-29T00:36:44Z</dc:date>
    </item>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327338#M120501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what I came up with - it seems to work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&amp;lt;Date = {"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;$(=addmonths(today()-1,-1))"}, Month= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load data up to yesterday: that's why it is today()-1.&amp;nbsp; The -1 in the second parameter of the addmonths function gives me last month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I sure wish the names of the functions were more consistant... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to John for a &lt;STRONG&gt;very &lt;/STRONG&gt;helpful answer - the fact that the column header, if not named, evaluates the set analysis expression is invaluable!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 00:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327338#M120501</guid>
      <dc:creator />
      <dc:date>2011-12-29T00:53:08Z</dc:date>
    </item>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327339#M120502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{&amp;lt;Date = {"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;$(=addmonths(today(),-1))"}, Month= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: took away today()&lt;STRONG&gt; -1&amp;nbsp; &lt;/STRONG&gt;as the less than is strict.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 01:26:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327339#M120502</guid>
      <dc:creator />
      <dc:date>2011-12-29T01:26:04Z</dc:date>
    </item>
    <item>
      <title>Previous MTD</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327340#M120503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{&amp;lt;Date = {"&amp;gt;=$(=monthstart(addmonths(today(),-1)))&amp;lt;$(=addmonths(today(),-1))"}, Month= &amp;gt;}&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 01:46:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-MTD/m-p/327340#M120503</guid>
      <dc:creator />
      <dc:date>2011-12-29T01:46:34Z</dc:date>
    </item>
  </channel>
</rss>

