<?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 YTD Expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233893#M85408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this in a new QV and you will get an idea:&lt;/P&gt;&lt;P&gt;Dates:&lt;BR /&gt;LOAD *,&lt;BR /&gt; month(Date) as Month,&lt;BR /&gt; year(Date) as Year,&lt;BR /&gt; week(Date) as Week,&lt;BR /&gt; inyeartodate(Date, today(), 0) * -1 as YTDFlag,&lt;BR /&gt; inyeartodate(Date, today(), -1) * -1 as PrevYTDFlag;&lt;BR /&gt;LOAD Date(today() - recno()) as Date&lt;BR /&gt;AUTOGENERATE 500;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2010 22:18:41 GMT</pubDate>
    <dc:creator>disqr_rm</dc:creator>
    <dc:date>2010-02-08T22:18:41Z</dc:date>
    <item>
      <title>YTD Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233892#M85407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to Qlikview and would like to create a YTD calculation using an expression. The calendar information we use contains a Year and Period combination. All help is welcome...Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 21:42:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233892#M85407</guid>
      <dc:creator />
      <dc:date>2010-02-08T21:42:57Z</dc:date>
    </item>
    <item>
      <title>YTD Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233893#M85408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this in a new QV and you will get an idea:&lt;/P&gt;&lt;P&gt;Dates:&lt;BR /&gt;LOAD *,&lt;BR /&gt; month(Date) as Month,&lt;BR /&gt; year(Date) as Year,&lt;BR /&gt; week(Date) as Week,&lt;BR /&gt; inyeartodate(Date, today(), 0) * -1 as YTDFlag,&lt;BR /&gt; inyeartodate(Date, today(), -1) * -1 as PrevYTDFlag;&lt;BR /&gt;LOAD Date(today() - recno()) as Date&lt;BR /&gt;AUTOGENERATE 500;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 22:18:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233893#M85408</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-08T22:18:41Z</dc:date>
    </item>
    <item>
      <title>YTD Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233894#M85409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The right approach depends a lot on the specifics.&lt;/P&gt;&lt;P&gt;If, say, you want a chart of current year data, showing both the month and the year to date for that month, you can simply turn on "full accumulation" on the expressions tab.&lt;/P&gt;&lt;P&gt;If you want the user to select one and only one month or date, you can use set analysis to "open up" your date range to include the year to date. Something like sum({&amp;lt;Date={"&amp;gt;=$(=yearstart(Date)) &amp;lt;=$(=Date)"}&amp;gt;} Sales).&lt;/P&gt;&lt;P&gt;If you want a chart of dates that could include multiple years, you can create a "date island", a list of all dates that is disconnected from your main data model, use it as the dimension, then connect those dates to your real dates in the expression. Something like sum(if(Date&amp;gt;=yearstart(DateIslandDate) and Date &amp;lt;=DateIslandDate,Sales)). It's a simple solution for small data sets, but can bog down on big data sets.&lt;/P&gt;&lt;P&gt;For a big data set, you could create a linkage table that connects your records to dates via a "date type". So you can have 'Current' and 'YTD' date types. For a given date and the 'Current' date type, you connect it only to records that happened on that exact date. For a given date and the 'YTD' date type, you connect it to all records with dates in the year to date. Then your expression just has to specify the date type. Something like sum({&amp;lt;DateType={'YTD'}&amp;gt;} Sales). That should perform better than the date island approach on large data sets, but is more complicatd to set up, and takes more memory.&lt;/P&gt;&lt;P&gt;Probably other approaches as well. We'll need more details if you need more details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 22:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD-Expressions/m-p/233894#M85409</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-02-08T22:19:17Z</dc:date>
    </item>
  </channel>
</rss>

