<?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 CURYTDFLAG Not Working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794670#M1049815</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone spot where I am going wrong with this 'Close Date' Calendar? CurYTDFlag is coming back with only a zero for each calendar record -- there is no '1' for 2014 records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Calendar for Close Date&lt;/P&gt;&lt;P&gt;MinMax:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Min("Close Date") as MinDate,&lt;/P&gt;&lt;P&gt;Max("Close Date") as MaxDate&lt;/P&gt;&lt;P&gt;Resident Opportunities;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(Peek('MinDate', 0, 'MinMax'));&lt;/P&gt;&lt;P&gt;LET vMaxDate = Num(Peek('MaxDate', 0, 'MinMax'));&lt;/P&gt;&lt;P&gt;LET vToday = Today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table MinMax;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*********************Temp Calendar*************&lt;/P&gt;&lt;P&gt;TempCal2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; date($(vMinDate) + RowNo() - 1) AS TempDate2&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate $(vMaxDate) - $(vMinDate) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//******************** MASTER CALENDAR *************************&lt;/P&gt;&lt;P&gt;MasterCalendar2:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;TempDate2 AS "Close Date",&lt;/P&gt;&lt;P&gt;Year(TempDate2) as YearClosed,&lt;/P&gt;&lt;P&gt;Month(TempDate2) as MonthClosed,&lt;/P&gt;&lt;P&gt;Day(TempDate2) as DayClosed,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(month(TempDate2) / 3) as QuarterClosed,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(Month(TempDate2) / 3) &amp;amp; '-' &amp;amp; Year(TempDate2) as QuarterYearClosed,&lt;/P&gt;&lt;P&gt;Date(monthstart(TempDate2),'MMM-YYYY') as MonthYearClosed,&lt;/P&gt;&lt;P&gt;InYearToDate(TempDate2, $(vToday), 0,10) * -1 AS CurYTDFlag,&lt;/P&gt;&lt;P&gt;InYearToDate(TempDate2, $(vToday), -1) * -1 as LastYTDFlag&lt;/P&gt;&lt;P&gt;Resident TempCal2&lt;/P&gt;&lt;P&gt;Order By TempDate2 ASC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table TempCal2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Nov 2014 23:24:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-09T23:24:18Z</dc:date>
    <item>
      <title>CURYTDFLAG Not Working</title>
      <link>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794670#M1049815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone spot where I am going wrong with this 'Close Date' Calendar? CurYTDFlag is coming back with only a zero for each calendar record -- there is no '1' for 2014 records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Calendar for Close Date&lt;/P&gt;&lt;P&gt;MinMax:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Min("Close Date") as MinDate,&lt;/P&gt;&lt;P&gt;Max("Close Date") as MaxDate&lt;/P&gt;&lt;P&gt;Resident Opportunities;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(Peek('MinDate', 0, 'MinMax'));&lt;/P&gt;&lt;P&gt;LET vMaxDate = Num(Peek('MaxDate', 0, 'MinMax'));&lt;/P&gt;&lt;P&gt;LET vToday = Today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table MinMax;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*********************Temp Calendar*************&lt;/P&gt;&lt;P&gt;TempCal2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; date($(vMinDate) + RowNo() - 1) AS TempDate2&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate $(vMaxDate) - $(vMinDate) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//******************** MASTER CALENDAR *************************&lt;/P&gt;&lt;P&gt;MasterCalendar2:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;TempDate2 AS "Close Date",&lt;/P&gt;&lt;P&gt;Year(TempDate2) as YearClosed,&lt;/P&gt;&lt;P&gt;Month(TempDate2) as MonthClosed,&lt;/P&gt;&lt;P&gt;Day(TempDate2) as DayClosed,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(month(TempDate2) / 3) as QuarterClosed,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil(Month(TempDate2) / 3) &amp;amp; '-' &amp;amp; Year(TempDate2) as QuarterYearClosed,&lt;/P&gt;&lt;P&gt;Date(monthstart(TempDate2),'MMM-YYYY') as MonthYearClosed,&lt;/P&gt;&lt;P&gt;InYearToDate(TempDate2, $(vToday), 0,10) * -1 AS CurYTDFlag,&lt;/P&gt;&lt;P&gt;InYearToDate(TempDate2, $(vToday), -1) * -1 as LastYTDFlag&lt;/P&gt;&lt;P&gt;Resident TempCal2&lt;/P&gt;&lt;P&gt;Order By TempDate2 ASC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table TempCal2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Nov 2014 23:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794670#M1049815</guid>
      <dc:creator />
      <dc:date>2014-11-09T23:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: CURYTDFLAG Not Working</title>
      <link>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794671#M1049816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to be a bug with the InYearToDate. If you use the Today() function instead of the variable it should work fine:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture78.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/70803_Capture78.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Nov 2014 23:55:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794671#M1049816</guid>
      <dc:creator>danieloberbilli</dc:creator>
      <dc:date>2014-11-09T23:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: CURYTDFLAG Not Working</title>
      <link>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794672#M1049817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe the calendar script from this thread helps:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/652214"&gt;Re: Re: Re: CUMULATIVE YEAR WITH MASTERCALENDAR&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14155772916695560" jivemacro_uid="_14155772916695560"&gt;
&lt;P&gt;OrderCalendar: &lt;/P&gt;
&lt;P&gt;LOAD Date as TCMSALESORDERDATE, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(Date) as TCMSALESORDERWeek, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Date) as TCMSALESORDERYear, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Date) as TCMSALESORDERMonth, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day(Date) as TCMSALESORDERDay, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YeartoDate(Date)*-1 as TCMSALESORDERCurYTDFlag, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YeartoDate(Date,-1)*-1 as TCMSALESORDERLastYTDFlag, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InYear(Date, Monthstart(MaxDate),-1) as TCMSALESORDERRC12, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(monthstart(Date), 'MMM-YYYY') as TCMSALESORDERMonthYear, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Q'&amp;amp;Ceil(Month(Date)/3) as TCMSALESORDERQuarter, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week(WeekStart(Date)) &amp;amp; '-' &amp;amp; WeekYear(Date) as TCMSALESORDERWeekYear, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WeekDay(Date) as TCMSALESORDERWeekDay; &lt;/P&gt;
&lt;P&gt;LOAD Date(MinDate+IterNo()-1) as Date, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxDate &lt;/P&gt;
&lt;P&gt;While MinDate+IterNo()-1&amp;lt;=MaxDate; &lt;/P&gt;
&lt;P&gt;LOAD Min(TCMSALESORDERDATE) as MinDate, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(TCMSALESORDERDATE) as MaxDate &lt;/P&gt;
&lt;P&gt;Resident OrderHeader;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Nov 2014 23:56:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794672#M1049817</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-11-09T23:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: CURYTDFLAG Not Working</title>
      <link>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794673#M1049818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Daniel -- that worked.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 01:16:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CURYTDFLAG-Not-Working/m-p/794673#M1049818</guid>
      <dc:creator />
      <dc:date>2014-11-10T01:16:57Z</dc:date>
    </item>
  </channel>
</rss>

