<?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: create date range variable for rolling 13 months in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345174#M29759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this as variable &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vTest='&amp;gt;'&amp;amp; (date(MonthStart(addmonths(Today(),-13)))) &amp;amp;'&amp;lt;='&amp;amp;(date(MonthEnd(Today())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;[Order Date]={"$(=$(vTest))"}&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 May 2017 13:45:05 GMT</pubDate>
    <dc:creator>aarkay29</dc:creator>
    <dc:date>2017-05-01T13:45:05Z</dc:date>
    <item>
      <title>create date range variable for rolling 13 months</title>
      <link>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345173#M29758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I am working on a chart that needs to show a default view of the last 13 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I want to reuse the same 13 month range for other visualizations so I’ll use a variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I think my set analysis should look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Count({&amp;lt;$(vAriable)&amp;gt;}Distinct Field1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-bidi-language: AR-SA; mso-fareast-language: EN-US; mso-bidi-font-family: 'Times New Roman'; color: #000000; font-size: 11pt; mso-ansi-language: EN-US; mso-hansi-theme-font: minor-latin; mso-fareast-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; font-family: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; mso-bidi-theme-font: minor-bidi;"&gt;I have the begin and end dates calculating correctly – when viewed through a KPI.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 12pt; font-family: Calibri;"&gt;date(MonthName(addmonths(vToday),-13)) gives me April 1, 2016 (which is correct)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 12pt; font-family: Calibri;"&gt;date(MonthEnd(vToday))&amp;nbsp;&amp;nbsp;&amp;nbsp; gives me May 31, 2017 (which is correct)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 12pt; font-family: Calibri;"&gt;vToday = Today()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I now need to put the range together in a format that will work in the variable – but I need some help please.&amp;nbsp; thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;This is where I am now…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 12pt; font-family: Calibri;"&gt;{"&amp;gt;$(=date(MonthName(addmonths(vToday),-13))) &amp;lt;=$(=date(MonthEnd(vToday)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 May 2017 13:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345173#M29758</guid>
      <dc:creator>jtay</dc:creator>
      <dc:date>2017-05-01T13:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: create date range variable for rolling 13 months</title>
      <link>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345174#M29759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this as variable &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vTest='&amp;gt;'&amp;amp; (date(MonthStart(addmonths(Today(),-13)))) &amp;amp;'&amp;lt;='&amp;amp;(date(MonthEnd(Today())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;[Order Date]={"$(=$(vTest))"}&amp;gt;}Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 May 2017 13:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345174#M29759</guid>
      <dc:creator>aarkay29</dc:creator>
      <dc:date>2017-05-01T13:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: create date range variable for rolling 13 months</title>
      <link>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345175#M29760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you have there is a little bit of tricky syntax. I have found that you have to calculate the entire string, you cannot just rely on the dollar sign expansion to concatenate the string together "&amp;gt;$()&amp;lt;=$()" syntax does not work. so something like this should do the trick... $(='&amp;gt;' &amp;amp; date(MonthName(addmonths(vToday),-13)) &amp;amp; '&amp;lt;=' &amp;amp; date(MonthEnd(vToday)))&lt;/P&gt;&lt;P&gt;I find that with this kind of expression you also need to make sure other calendar selections are not conflicting with the 13 month set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 May 2017 13:48:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345175#M29760</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2017-05-01T13:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: create date range variable for rolling 13 months</title>
      <link>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345176#M29761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chris - your last sentence gets to the root of the problem.&amp;nbsp; We need to be able to select dates within and also outside that 13 month range and have the graph update.&amp;nbsp; This is what I ended up putting together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;My variable $(vRolling13) = MonthSequence = {"&amp;gt;$(=max(MonthSequence)-14)&amp;lt;=$(=max(MonthSequence))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;Monthsequence is just a number count assigned to each month in the master calendar.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Count({&amp;lt;$(vRolling13) &amp;gt;} Distinct Value1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;thanks! &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 16:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/create-date-range-variable-for-rolling-13-months/m-p/1345176#M29761</guid>
      <dc:creator>jtay</dc:creator>
      <dc:date>2017-05-18T16:15:24Z</dc:date>
    </item>
  </channel>
</rss>

