<?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: Redefining InYTD in autoCalendar with a Lookup() in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Redefining-InYTD-in-autoCalendar-with-a-Lookup/m-p/1769848#M59544</link>
    <description>&lt;P&gt;If anyone has any advice or if you know the scope of this function it would be highly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2020 15:00:58 GMT</pubDate>
    <dc:creator>smithc2005</dc:creator>
    <dc:date>2020-12-21T15:00:58Z</dc:date>
    <item>
      <title>Redefining InYTD in autoCalendar with a Lookup()</title>
      <link>https://community.qlik.com/t5/App-Development/Redefining-InYTD-in-autoCalendar-with-a-Lookup/m-p/1768726#M59466</link>
      <description>&lt;P&gt;I'm having some trouble redefining inYTD in the predefined autoCalendar. I need to use a combination of business month and day from a separate table to control the flag. The input is a regular date field. I have confirmed that my IF statement works outside of the derived field declarations and I am receiving the expected output. I tried pulling the inYTD field into a straight table and was expecting to see "1" and "0". I got an invalid dimension error, instead. &lt;STRONG&gt;My guess is that this area of code cannot see the tables loaded in the previous section? Or is it the $1 placeholder?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-12-15 140412.png" style="width: 621px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/45717iB01A2EA4CC17B392/image-dimensions/621x176?v=v2" width="621" height="176" role="button" title="Screenshot 2020-12-15 140412.png" alt="Screenshot 2020-12-15 140412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The line in question is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If (Lookup('BUS_MONTHDAY','GREGORIAN_DATE',Date($1),'CALENDAR') &amp;lt;= Lookup('BUS_MONTHDAY','GREGORIAN_DATE',Today()-1,'CALENDAR'), 1, 0) AS [InYTD] &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the entire autoCalendar.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[autoCalendar]: 
  DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
  Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
  Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
  Dual(Year($1)&amp;amp;'-Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
  Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
  Month($1) AS [Month] Tagged ('$month', '$cyclic'),
  Dual(Year($1)&amp;amp;'-'&amp;amp;Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
  Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
  Dual('W'&amp;amp;Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),
  Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
  Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified'),
  If (Lookup('BUS_MONTHDAY','GREGORIAN_DATE',Date($1),'CALENDAR') &amp;lt;= Lookup('BUS_MONTHDAY','GREGORIAN_DATE',Today()-1,'CALENDAR'), 1, 0) AS [InYTD] ,
  Year(Today()-1)-Year($1) AS [YearsAgo] ,
  If (DayNumberOfQuarter($1) &amp;lt;= DayNumberOfQuarter(Today()-1),1,0) AS [InQTD] ,
  4*Year(Today()-1)+Ceil(Month(Today()-1)/3)-4*Year($1)-Ceil(Month($1)/3) AS [QuartersAgo] ,
  Ceil(Month(Today()-1)/3)-Ceil(Month($1)/3) AS [QuarterRelNo] ,
  If(Day($1)&amp;lt;=Day(Today()-1),1,0) AS [InMTD] ,
  12*Year(Today()-1)+Month(Today()-1)-12*Year($1)-Month($1) AS [MonthsAgo] ,
  Month(Today()-1)-Month($1) AS [MonthRelNo] ,
  If(WeekDay($1)&amp;lt;=WeekDay(Today()-1),1,0) AS [InWTD] ,
  (WeekStart(Today()-1)-WeekStart($1))/7 AS [WeeksAgo] ,
  Week(Today()-1)-Week($1) AS [WeekRelNo];

DERIVE FIELDS FROM FIELDS [GREGORIAN_DATE] USING [autoCalendar];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Redefining-InYTD-in-autoCalendar-with-a-Lookup/m-p/1768726#M59466</guid>
      <dc:creator>smithc2005</dc:creator>
      <dc:date>2024-11-16T00:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Redefining InYTD in autoCalendar with a Lookup()</title>
      <link>https://community.qlik.com/t5/App-Development/Redefining-InYTD-in-autoCalendar-with-a-Lookup/m-p/1769848#M59544</link>
      <description>&lt;P&gt;If anyone has any advice or if you know the scope of this function it would be highly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 15:00:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Redefining-InYTD-in-autoCalendar-with-a-Lookup/m-p/1769848#M59544</guid>
      <dc:creator>smithc2005</dc:creator>
      <dc:date>2020-12-21T15:00:58Z</dc:date>
    </item>
  </channel>
</rss>

