<?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: Get last 12 months rolling data based on Month selection in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079988#M88582</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I recommend you&amp;nbsp; to have DATE in numeric format, because it make the thinks easy to make the set analysis.&lt;BR /&gt;&lt;BR /&gt;Left assume you have 01/02/2023 selected, so its this as number you create a variable like this:&lt;BR /&gt;Ps; I recommend 2 variables:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vL.MaxDate = Num(Floor(Max(YOUR_DATE_FIELD)))&lt;BR /&gt;vL.LastYearDate = Num(Floor(Max(YOUR_DATE_FIELD))) - 365&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have this 2 variables you set analysis will be&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//New Set Analysis Way
{&amp;lt; YOUR_DATE_FIELD =,  YOUR_DATE_FIELD = "&amp;gt;=$(vL.LastYearDate) &amp;lt;=$(vL.MaxDate) &amp;gt;}  Sum(Sales)

//Old Set analysis Way
Sum({&amp;lt; YOUR_DATE_FIELD =,  YOUR_DATE_FIELD = "&amp;gt;=$(vL.LastYearDate) &amp;lt;=$(vL.MaxDate) &amp;gt;} Sales)
&lt;/LI-CODE&gt;
&lt;P&gt;Don't forget to add all your possible date fields to be ignored using: FIELD =, in the set analysis, because then you saying:&lt;/P&gt;
&lt;P&gt;Ignore what the user select and calculate use&amp;nbsp; what i sent to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this works 100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="srchagas_0-1685952161054.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109201iE1CB8DB0D9080A93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="srchagas_0-1685952161054.png" alt="srchagas_0-1685952161054.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 08:02:47 GMT</pubDate>
    <dc:creator>srchagas</dc:creator>
    <dc:date>2023-06-05T08:02:47Z</dc:date>
    <item>
      <title>Get last 12 months rolling data based on Month selection</title>
      <link>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079929#M88572</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;
&lt;P&gt;I need one help . I have one Year and a Month Filter as a drop down.&lt;/P&gt;
&lt;P&gt;If I select 2023 as a Year and Feb as a month from drop down selection,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sum (Sales) : should return data from 2023 Feb to 2022 Feb (Last 12 months).&lt;/P&gt;
&lt;P&gt;Note : Month drop down has been declared as a varibale : $(vMonth)&lt;/P&gt;
&lt;P&gt;Can you please help on that ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:43:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079929#M88572</guid>
      <dc:creator>Ipsita20191</dc:creator>
      <dc:date>2024-11-15T21:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get last 12 months rolling data based on Month selection</title>
      <link>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079968#M88578</link>
      <description>&lt;P&gt;You can do it in the set analysis using the function AddMonth (Month, -12)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 07:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079968#M88578</guid>
      <dc:creator>Sabrina_V</dc:creator>
      <dc:date>2023-06-05T07:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get last 12 months rolling data based on Month selection</title>
      <link>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079988#M88582</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I recommend you&amp;nbsp; to have DATE in numeric format, because it make the thinks easy to make the set analysis.&lt;BR /&gt;&lt;BR /&gt;Left assume you have 01/02/2023 selected, so its this as number you create a variable like this:&lt;BR /&gt;Ps; I recommend 2 variables:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vL.MaxDate = Num(Floor(Max(YOUR_DATE_FIELD)))&lt;BR /&gt;vL.LastYearDate = Num(Floor(Max(YOUR_DATE_FIELD))) - 365&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have this 2 variables you set analysis will be&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//New Set Analysis Way
{&amp;lt; YOUR_DATE_FIELD =,  YOUR_DATE_FIELD = "&amp;gt;=$(vL.LastYearDate) &amp;lt;=$(vL.MaxDate) &amp;gt;}  Sum(Sales)

//Old Set analysis Way
Sum({&amp;lt; YOUR_DATE_FIELD =,  YOUR_DATE_FIELD = "&amp;gt;=$(vL.LastYearDate) &amp;lt;=$(vL.MaxDate) &amp;gt;} Sales)
&lt;/LI-CODE&gt;
&lt;P&gt;Don't forget to add all your possible date fields to be ignored using: FIELD =, in the set analysis, because then you saying:&lt;/P&gt;
&lt;P&gt;Ignore what the user select and calculate use&amp;nbsp; what i sent to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this works 100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="srchagas_0-1685952161054.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/109201iE1CB8DB0D9080A93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="srchagas_0-1685952161054.png" alt="srchagas_0-1685952161054.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 08:02:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Get-last-12-months-rolling-data-based-on-Month-selection/m-p/2079988#M88582</guid>
      <dc:creator>srchagas</dc:creator>
      <dc:date>2023-06-05T08:02:47Z</dc:date>
    </item>
  </channel>
</rss>

