<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260744#M1184302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG /&gt;=Sum({$&amp;lt;ANNEE={$(=Max(ANNEE)-1)}, BDLE_D_DATE={'&amp;lt;=$(=AddYears(vDate,-1))'}&amp;gt;} SALES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this for 2010 (Year -1 ) but how can i have the same for 2009 2008 and 2007 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7998" alt="ytd.jpg" class="jive-image-thumbnail jive-image" src="https://community.qlik.com/legacyfs/online/7998_ytd.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Oct 2011 15:33:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-10-20T15:33:10Z</dc:date>
    <item>
      <title>YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260742#M1184300</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;i want to calculate YTD and YTD -1 .&lt;/P&gt;&lt;P&gt;i have this right now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;YEAR = {$(=max(YEAR))}, MONTH = {"&amp;lt;=$(=max({&amp;lt;YEAR={$(=max(YEAR))}&amp;gt;} MONTH))"}&amp;gt;} VALUESALES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;YEAR = {$(=max(YEAR - 1))}, MONTH = {"&amp;lt;=$(=max({&amp;lt;YEAR={$(=max(YEAR))}&amp;gt;} MONTH))"}&amp;gt;} VALUESALES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what i want is to go do the exact day in the month, not just the month&lt;/P&gt;&lt;P&gt;ex: from (YTD-1) 01.01.2009 to 19.10.2009 and 01.01.2010 to 19.10.2010 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea how to complete this function to do so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 19:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260742#M1184300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-19T19:16:17Z</dc:date>
    </item>
    <item>
      <title>YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260743#M1184301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerome,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a very similar issue solved few hours ago in &lt;A _jive_internal="true" href="https://community.qlik.com/message/159090#159090"&gt;this thread&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 20:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260743#M1184301</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-19T20:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260744#M1184302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG /&gt;=Sum({$&amp;lt;ANNEE={$(=Max(ANNEE)-1)}, BDLE_D_DATE={'&amp;lt;=$(=AddYears(vDate,-1))'}&amp;gt;} SALES)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this for 2010 (Year -1 ) but how can i have the same for 2009 2008 and 2007 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7998" alt="ytd.jpg" class="jive-image-thumbnail jive-image" src="https://community.qlik.com/legacyfs/online/7998_ytd.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 15:33:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260744#M1184302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T15:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260745#M1184303</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;I'd rather use the flags in the calendar table so you can show as many years comparing to the current as you want. You can even create a flag that will return true for all dates of al years from January 1 to today for 2009, 2010, 2011...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the attached example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 17:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260745#M1184303</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260746#M1184304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would rather prefer to do it directly in the definition field of the chart&lt;/P&gt;&lt;P&gt;can you help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 18:20:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260746#M1184304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T18:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260747#M1184305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerome,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid I don't understand quite well what you are up to. Would you please elaborate or upload some sample data so we can see what do you want to do and how to get the best solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 19:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260747#M1184305</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T19:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260748#M1184306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want an expression that is valable for all the years in the chart, not only for year -1 (see image)&lt;/P&gt;&lt;P&gt;in BLUE ist the year sales from 01.01.YYYY to 31.12.YYYY&lt;/P&gt;&lt;P&gt;i want a second bar in the chart for each year with the sales from 01.01.YYYY to TODAY (pex 20.10.YYYY)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 19:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260748#M1184306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-20T19:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260749#M1184307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jerome,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use one dimension (Year) and two expressions, one without filter that will return the aggregated value of SALES per year&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"&gt;&lt;P&gt;SUM(SALES)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the other expression using the Date field compared to the result of the YearToDate function (that will return true/-1 if the date is between 01/01 and today)&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"&gt;&lt;P&gt;SUM({&amp;lt; BDLE_D_DATE = {"=YearToDate(BDLE_D_DATE, Year(BDLE_D_DATE) - Year(Today())) = -1"} &amp;gt;} SALES)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this expression may not work because the YearToDate() function as everyting in the set analysis is evaluated once and for the whole chart, before rendering it, and not row by row. In this second case, you will need to use a If() condition that will slower your chart, and make cumbersome to write and debug your expressions, or even to create a caculated dimension to get only those dates that match the YTD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is far easier to maintain and to code the field in the Calendar table and use that flag later on in your tables, hence my suggestion in the attached applications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 20:32:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260749#M1184307</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-20T20:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: YTD</title>
      <link>https://community.qlik.com/t5/QlikView/YTD/m-p/260750#M1184308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GREAT!!! it's working!!!&lt;/P&gt;&lt;P&gt;thany very very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 09:31:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YTD/m-p/260750#M1184308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-21T09:31:10Z</dc:date>
    </item>
  </channel>
</rss>

