<?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: Previous month figures in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231838#M392468</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another (and probably a slightly better option is to use this)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;&lt;SPAN style="color: #ff0000;"&gt;MonthYear&lt;/SPAN&gt; = {"$(=Date(MonthStart(Max(&lt;SPAN style="color: #ff0000;"&gt;MonthYear&lt;/SPAN&gt;), -1), 'MMM YYYY'))"}, Mois, Année&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here MonthYear is created using Date() function rather than MonthName() function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendrier:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD MaDate as Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Year(MaDate) as Année,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'Q ' &amp;amp; Num(Ceil(Month(MaDate)/3),'(ROM)0') as Trimestre, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Month(MaDate) as Mois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MonthEnd(MaDate)as DateFinMois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Week(MaDate) as Semaine,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Weekday(MaDate) as JourSemaine,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Day(MaDate) as Jour,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MonthName(MaDate) as Année_Mois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Date(MonthStart(MaDate), 'MMM YYYY') as MonthYear&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESIDENT ChampDate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date() works better in set analysis when doing ranges compared to MonthName. So if you would want to do range (for instance 6 months) then Date will work much better here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Mar 2017 01:38:29 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-03-05T01:38:29Z</dc:date>
    <item>
      <title>Previous month figures</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231836#M392466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a database showing date and sales.&lt;/P&gt;&lt;P&gt;i would like to show in a text box the sales of the previous month depending on the month selected by the user.&lt;/P&gt;&lt;P&gt;No issue to get the previous year figure but i am struggling with the previous month formulas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, for Jan 2017 as the period selected, the output of the sales M-1 text box should be 21 (as 21 is the sales of Dec 2016)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/155258_Capture.JPG" style="height: 249px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Attached is qvd and excel test database for the ones you mignt want to help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Mar 2017 23:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231836#M392466</guid>
      <dc:creator>guillaume_gorli</dc:creator>
      <dc:date>2017-03-04T23:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month figures</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231837#M392467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Année_Mois = {"$(=MonthName(Max(Année_Mois), -1))"}, Mois, Année&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 01:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231837#M392467</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-05T01:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month figures</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231838#M392468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another (and probably a slightly better option is to use this)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;&lt;SPAN style="color: #ff0000;"&gt;MonthYear&lt;/SPAN&gt; = {"$(=Date(MonthStart(Max(&lt;SPAN style="color: #ff0000;"&gt;MonthYear&lt;/SPAN&gt;), -1), 'MMM YYYY'))"}, Mois, Année&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here MonthYear is created using Date() function rather than MonthName() function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendrier:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD MaDate as Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Year(MaDate) as Année,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'Q ' &amp;amp; Num(Ceil(Month(MaDate)/3),'(ROM)0') as Trimestre, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Month(MaDate) as Mois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MonthEnd(MaDate)as DateFinMois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Week(MaDate) as Semaine,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Weekday(MaDate) as JourSemaine,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Day(MaDate) as Jour,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MonthName(MaDate) as Année_Mois,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Date(MonthStart(MaDate), 'MMM YYYY') as MonthYear&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RESIDENT ChampDate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date() works better in set analysis when doing ranges compared to MonthName. So if you would want to do range (for instance 6 months) then Date will work much better here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 01:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231838#M392468</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-05T01:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month figures</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231839#M392469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Sunny, This is exactly what i was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always you are big help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guillaume&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 16:25:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month-figures/m-p/1231839#M392469</guid>
      <dc:creator>guillaume_gorli</dc:creator>
      <dc:date>2017-03-05T16:25:37Z</dc:date>
    </item>
  </channel>
</rss>

