<?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: Filter Pane Date: Last 30 Days Syntax Error in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Filter-Pane-Date-Last-30-Days-Syntax-Error/m-p/133823#M9424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your dateformat is MM-dd-yyyy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Date &amp;gt; $(vCalenderEnd) - 30 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates are dual and will be numbers when needed...&lt;/P&gt;&lt;P&gt;Sometimes you need to add Num($(vCalenardEnd))... the magic of dual for dates doesn't always seem to work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2018 16:46:19 GMT</pubDate>
    <dc:creator>dwforest</dc:creator>
    <dc:date>2018-08-13T16:46:19Z</dc:date>
    <item>
      <title>Filter Pane Date: Last 30 Days Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Filter-Pane-Date-Last-30-Days-Syntax-Error/m-p/133822#M9423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having a syntax issue trying to create a field for the last 30 days. What I have is the Qlik sense auto calendar a a few lines of code I have added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue appears in the vCalendarStart. I am thinking it has something to do with the date format. However I have not found a combination it will accept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210661_pastedImage_26.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the actual code so that it is easy to recreate:&lt;/P&gt;&lt;P&gt;Note: My data starts at 07-01-2018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;et &lt;BR /&gt;LET vCalendarStart = Date('07-01-2018'); // Static start&lt;BR /&gt;LET vCalendarEnd = Date(today()); // Today&lt;/P&gt;&lt;P&gt;LET vCalendarLength = Num(Date#(vCalendarEnd)) - Num(Date#(vCalendarStart)) + 1;&lt;/P&gt;&lt;P&gt; Calendar:&lt;BR /&gt;LOAD &lt;BR /&gt;If(Date &amp;gt; Date('$(vCalendarEnd)'-30) and Date &amp;lt;= Date('$(vCalendarEnd)'), 1,0) as Last30Days;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Date($(#vCalendarStart) + RecNo()-1) AS Mod.Date&amp;nbsp; &lt;BR /&gt;AutoGenerate $(#vCalendarLength); &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[autoCalendar]: &lt;BR /&gt;&amp;nbsp; DECLARE FIELD DEFINITION Tagged ('$date')&lt;BR /&gt;FIELDS&lt;BR /&gt;&amp;nbsp; Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),&lt;BR /&gt;&amp;nbsp; Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),&lt;BR /&gt;&amp;nbsp; Dual(Year($1)&amp;amp;'-Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),&lt;BR /&gt;&amp;nbsp; Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),&lt;BR /&gt;&amp;nbsp; Month($1) AS [Month] Tagged ('$month', '$cyclic'),&lt;BR /&gt;&amp;nbsp; Dual(Year($1)&amp;amp;'-'&amp;amp;Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),&lt;BR /&gt;&amp;nbsp; Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),&lt;BR /&gt;&amp;nbsp; Dual('W'&amp;amp;Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&lt;BR /&gt;&amp;nbsp; Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),&lt;BR /&gt;&amp;nbsp; Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified'),&lt;BR /&gt;&amp;nbsp; If (DayNumberOfYear($1) &amp;lt;= DayNumberOfYear(Today()), 1, 0) AS [InYTD] ,&lt;BR /&gt;&amp;nbsp; Year(Today())-Year($1) AS [YearsAgo] ,&lt;BR /&gt;&amp;nbsp; If (DayNumberOfQuarter($1) &amp;lt;= DayNumberOfQuarter(Today()),1,0) AS [InQTD] ,&lt;BR /&gt;&amp;nbsp; 4*Year(Today())+Ceil(Month(Today())/3)-4*Year($1)-Ceil(Month($1)/3) AS [QuartersAgo] ,&lt;BR /&gt;&amp;nbsp; Ceil(Month(Today())/3)-Ceil(Month($1)/3) AS [QuarterRelNo] ,&lt;BR /&gt;&amp;nbsp; If(Day($1)&amp;lt;=Day(Today()),1,0) AS [InMTD] ,&lt;BR /&gt;&amp;nbsp; 12*Year(Today())+Month(Today())-12*Year($1)-Month($1) AS [MonthsAgo] ,&lt;BR /&gt;&amp;nbsp; Month(Today())-Month($1) AS [MonthRelNo] ,&lt;BR /&gt;&amp;nbsp; If(WeekDay($1)&amp;lt;=WeekDay(Today()),1,0) AS [InWTD] ,&lt;BR /&gt;&amp;nbsp; (WeekStart(Today())-WeekStart($1))/7 AS [WeeksAgo] ,&lt;BR /&gt;&amp;nbsp; Week(Today())-Week($1) AS [WeekRelNo] ;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;DERIVE FIELDS FROM FIELDS [Date] USING [autoCalendar] ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 14:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filter-Pane-Date-Last-30-Days-Syntax-Error/m-p/133822#M9423</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-13T14:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Pane Date: Last 30 Days Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Filter-Pane-Date-Last-30-Days-Syntax-Error/m-p/133823#M9424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your dateformat is MM-dd-yyyy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Date &amp;gt; $(vCalenderEnd) - 30 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates are dual and will be numbers when needed...&lt;/P&gt;&lt;P&gt;Sometimes you need to add Num($(vCalenardEnd))... the magic of dual for dates doesn't always seem to work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 16:46:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Filter-Pane-Date-Last-30-Days-Syntax-Error/m-p/133823#M9424</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2018-08-13T16:46:19Z</dc:date>
    </item>
  </channel>
</rss>

