<?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: Dynamic 'previous month' Selctions in Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409149#M33045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you share sample app or screenshot of data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 04 Nov 2017 03:30:41 GMT</pubDate>
    <dc:creator>shraddha_g</dc:creator>
    <dc:date>2017-11-04T03:30:41Z</dc:date>
    <item>
      <title>Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409144#M33040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a KPI number where I want to basically show the current month amount and the previous month amount, based on the month a user selects. Current month works fine using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month={$(=MaxString(Month))} &amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot get the previous month when simply including the '-1' or am I missing something obvious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be great!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 10:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409144#M33040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-03T10:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409145#M33041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rishi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try below:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;= sum({&amp;lt;Month={$(=MaxString(Month))} &amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({&amp;lt;Month={$(=MaxString(Month),-1)} &amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Arvind Patil&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409145#M33041</guid>
      <dc:creator>arvind_patil</dc:creator>
      <dc:date>2017-11-03T11:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409146#M33042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month={"$(=max(Month)-1)"} &amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Month={"$(=num(Max(Month))-1)"} &amp;gt;}Amount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409146#M33042</guid>
      <dc:creator>shraddha_g</dc:creator>
      <dc:date>2017-11-03T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409147#M33043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arvind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes iv tried that already but had no luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:14:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409147#M33043</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-03T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409148#M33044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shraddha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried that but still does no luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:33:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409148#M33044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-03T11:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409149#M33045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you share sample app or screenshot of data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Nov 2017 03:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409149#M33045</guid>
      <dc:creator>shraddha_g</dc:creator>
      <dc:date>2017-11-04T03:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409150#M33046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rishi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the month field numeric?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens when you then have more than one year of data? Would it not be better to use Month and year?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i was building this, i would create a variable for vCurrentMonth and vPreviousMonth and then use the following set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Month&lt;/SPAN&gt;={"$(vCurrentMonth)"}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;={"$(vPreviousMonth)"}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can then set up a calc in each to work out the current and previous month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=month(addmonths(max(Month),-1)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Year(addmonths(max(Month),-1))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409150#M33046</guid>
      <dc:creator>Simon_J</dc:creator>
      <dc:date>2017-11-23T11:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 'previous month' Selctions in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409151#M33047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a few more attempts I managed to get it working similar to what you mentioned. The syntax for the set analysis in Qlik Sense using a variables is slightly different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCurrentMonth&amp;nbsp;&amp;nbsp; = Date(max([MonthYear]), 'MMM-YY')&lt;/P&gt;&lt;P&gt;vPreviousMonth = Date(addmonths(max([MonthYear]), -1), 'MMM-YY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;MonthYear ={'$(=$(vCurrentMonth))'}&amp;gt;}[Expense Amt])&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}&amp;gt;}[Expense Amt])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Nov 2017 11:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-previous-month-Selctions-in-Set-Analysis/m-p/1409151#M33047</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-23T11:51:49Z</dc:date>
    </item>
  </channel>
</rss>

