<?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: Date variable in Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183605#M21979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or this with variable&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;&lt;STRONG&gt;Avg({$&amp;lt;ReportDate = {"$(=Date(vMaxReportDate))"}&amp;gt;}Slope)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Sep 2016 23:33:35 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-09-13T23:33:35Z</dc:date>
    <item>
      <title>Date variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183603#M21977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm really struggling with some date variables and using them in set analysis.&lt;/P&gt;&lt;P&gt;Here is what I'm working with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Forecasttemp:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Crosstable (ForecastDate, ForecastUtilization, 2)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load *&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; FROM [lib://source]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(ooxml, embedded labels, table is [Forecast]);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ForecastData:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;noconcatenate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; AutoNumber(Port) as PortKey,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#([Report Date], 'M/D/YYYY')) as ReportDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForecastUtilization,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Forecasttemp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;drop table Forecasttemp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ReportDateTemp:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(ReportDate) as MaxReportDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; min(ReportDate) as MinReportDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident ForecastData;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMaxReportDate = Peek('MaxReportDate');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vMinReportDate = Peek('MinReportDate');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Drop Table ReportDateTemp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a ReportDate and vMax and vMinReportDate - obviously they're producing different formats.&amp;nbsp; I have no idea why.&lt;/P&gt;&lt;P&gt;In a nutshell, I want to limit expressions by Min and Max ReportDate in set analysis.&amp;nbsp; Easy, right????&lt;/P&gt;&lt;P&gt;5+ hours of reading/playing with various combinations and options says it's not.&amp;nbsp; I hope I'm just an idiot &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are KPIs from the 2 methods using the default Qlik Sense 3.0 AUTO number formatting (note different format for same date).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ReportDate.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/137351_ReportDate.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are a few of the expressions I've tried (I've read HICs articles and dozens of other articles answered by Stefan and Sunnie as well on the topic and I think I've tried all of the options suggested for the individuals to no avail)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg({$&amp;lt;ReportDate = {'$(=$(vMaxReportDate))'}&amp;gt;}Slope)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Avg({$&amp;lt;ReportDate = {$(=Max(ReportDate))}&amp;gt;}Slope)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg({$&amp;lt;ReportDate = {"=$(=$(vMaxReportDate))"}&amp;gt;}Slope) - this one produces a result, however it not correct - it's averaging data from all report dates, not just the max - which should be just the one number.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So many $, ', ", (, =$, $= combinations, there doesn't seem to be any hard and fast rules for any of it.&lt;/P&gt;&lt;P&gt;Help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 23:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183603#M21977</guid>
      <dc:creator>joey_lutes</dc:creator>
      <dc:date>2016-09-13T23:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183604#M21978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&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;&lt;STRONG&gt;Avg({$&amp;lt;ReportDate = {"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(=Date(Max(ReportDate)))"}&lt;/SPAN&gt;&amp;gt;}Slope)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this for minimum&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Avg({$&amp;lt;ReportDate = {"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;$(=Date(Min(ReportDate)))"}&lt;/SPAN&gt;&amp;gt;}Slope)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 23:32:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183604#M21978</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-13T23:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183605#M21979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or this with variable&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;&lt;STRONG&gt;Avg({$&amp;lt;ReportDate = {"$(=Date(vMaxReportDate))"}&amp;gt;}Slope)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 23:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183605#M21979</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-13T23:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Date variable in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183606#M21980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're amazing.&lt;/P&gt;&lt;P&gt;I'll add this to the archives and hopefully learning will occur &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 15:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Date-variable-in-Set-Analysis/m-p/1183606#M21980</guid>
      <dc:creator>joey_lutes</dc:creator>
      <dc:date>2016-09-14T15:34:33Z</dc:date>
    </item>
  </channel>
</rss>

