<?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: YTD Flag Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303622#M845038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the help, that works very well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Mar 2017 15:15:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-30T15:15:25Z</dc:date>
    <item>
      <title>YTD Flag Question</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303620#M845036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my script editor I have a code that works perfectly fine, but I am looking to make an update to it.&amp;nbsp; Sometimes when I am working on my data, the lag between when the data comes in is more than one month, and sometimes it is not even a month.&amp;nbsp; Currently I am basing my YTD off of addmonths(Today()-1).&amp;nbsp; Code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InYearToDate(NewDate, addmonths(today(),-1) ,-1) *-1 as CalendarPYTD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to change it something related to date(max(NewDate)) or &lt;/P&gt;&lt;P&gt;date#(MakeDate($(vBusinessYear),max({&amp;lt;CalendarYear={$(=max(CalendarYear))}&amp;gt;} CalendarMonth),1)).&amp;nbsp; In both cases that would properly return 02 for Feb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However each time the code fails.&amp;nbsp; Any thoughts on how to best update this code so it is based off of the latest month in the Current Year of my data set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303620#M845036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Flag Question</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303621#M845037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Fact:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM Fact;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MaxDate:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Max(Date) as MaxDate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident &lt;SPAN style="font-size: 13.3333px;"&gt;Fact;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vMaxDate = Peek('&lt;SPAN style="font-size: 13.3333px;"&gt;MaxDate&lt;/SPAN&gt;');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table MaxDate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendar:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD ...,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;InYearToDate(NewDate, addmonths(&lt;SPAN style="color: #ff0000;"&gt;$(&lt;SPAN style="font-size: 13.3333px;"&gt;vMaxDate&lt;/SPAN&gt;)&lt;/SPAN&gt;, -1) ,-1) *-1 as CalendarPYTD,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 21:03:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303621#M845037</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-29T21:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Flag Question</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303622#M845038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the help, that works very well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 15:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Flag-Question/m-p/1303622#M845038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-30T15:15:25Z</dc:date>
    </item>
  </channel>
</rss>

