<?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 formula: Previous Year with inYearToDate function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154074#M30836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;hope you can help me once more with a combination of this two formulas:&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;( {$ &amp;lt; &lt;B&gt;Year&lt;/B&gt;= {&lt;B&gt;&lt;I&gt;$(=year(addyears(MaxOrderDate,-1)))&lt;/I&gt;&lt;/B&gt;}, &lt;B&gt;CostumerType&lt;/B&gt;={&lt;B&gt;Dritte&lt;/B&gt;} &amp;gt; } &lt;B&gt;AmountSales&lt;/B&gt;)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;inYearToDate&lt;/B&gt;(&lt;B&gt;InvoiceDate&lt;/B&gt;,&lt;B&gt;MaxOrderDate&lt;/B&gt;,0) &lt;B&gt;and&lt;/B&gt; &lt;B&gt;CostumerType&lt;/B&gt;='Dritte' ,&lt;B&gt;AmountSales&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i want is: Qlikview should always calculate the Previous Year figures, when no selections then it is 2009 (currently), but they should be also considered, so when i select 2008, QV should bring 2007 figures. This function should be combined with an inYearTodate function.&lt;/P&gt;&lt;P&gt;So when (without selections) the MaxOrderDate is 22.10.10, i want the figures from 2009 as YTD 22.10.2009.&lt;/P&gt;&lt;P&gt;When i select 2009 (then MaxOrderDate becomes 31.12.2009, then i want the figures YTD per 31.12.2008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i tried is the following:&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( {$ &amp;lt; JahrBel = {$(=year(addyears(MaxOrderDate,-1)))}, Kundenart={Dritte} &amp;gt; } $(=if(inYearToDate(Fakturadat,MaxOrderDate,-1),WertOBIC)))&lt;/P&gt;&lt;P&gt;Suprise, Suprise it didnt work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your ideas, i rely on your cleverness,&lt;/P&gt;&lt;P&gt;christoph&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Oct 2010 09:46:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-22T09:46:17Z</dc:date>
    <item>
      <title>formula: Previous Year with inYearToDate function</title>
      <link>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154074#M30836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;hope you can help me once more with a combination of this two formulas:&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;( {$ &amp;lt; &lt;B&gt;Year&lt;/B&gt;= {&lt;B&gt;&lt;I&gt;$(=year(addyears(MaxOrderDate,-1)))&lt;/I&gt;&lt;/B&gt;}, &lt;B&gt;CostumerType&lt;/B&gt;={&lt;B&gt;Dritte&lt;/B&gt;} &amp;gt; } &lt;B&gt;AmountSales&lt;/B&gt;)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;inYearToDate&lt;/B&gt;(&lt;B&gt;InvoiceDate&lt;/B&gt;,&lt;B&gt;MaxOrderDate&lt;/B&gt;,0) &lt;B&gt;and&lt;/B&gt; &lt;B&gt;CostumerType&lt;/B&gt;='Dritte' ,&lt;B&gt;AmountSales&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i want is: Qlikview should always calculate the Previous Year figures, when no selections then it is 2009 (currently), but they should be also considered, so when i select 2008, QV should bring 2007 figures. This function should be combined with an inYearTodate function.&lt;/P&gt;&lt;P&gt;So when (without selections) the MaxOrderDate is 22.10.10, i want the figures from 2009 as YTD 22.10.2009.&lt;/P&gt;&lt;P&gt;When i select 2009 (then MaxOrderDate becomes 31.12.2009, then i want the figures YTD per 31.12.2008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i tried is the following:&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( {$ &amp;lt; JahrBel = {$(=year(addyears(MaxOrderDate,-1)))}, Kundenart={Dritte} &amp;gt; } $(=if(inYearToDate(Fakturadat,MaxOrderDate,-1),WertOBIC)))&lt;/P&gt;&lt;P&gt;Suprise, Suprise it didnt work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your ideas, i rely on your cleverness,&lt;/P&gt;&lt;P&gt;christoph&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 09:46:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154074#M30836</guid>
      <dc:creator />
      <dc:date>2010-10-22T09:46:17Z</dc:date>
    </item>
    <item>
      <title>formula: Previous Year with inYearToDate function</title>
      <link>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154075#M30837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christoph,&lt;/P&gt;&lt;P&gt;please see the attached example for help.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 11:43:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154075#M30837</guid>
      <dc:creator />
      <dc:date>2010-10-22T11:43:59Z</dc:date>
    </item>
    <item>
      <title>formula: Previous Year with inYearToDate function</title>
      <link>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154076#M30838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the late response Rainer, its busy budgeting time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think your formula should do a great job, but I will use the yearstart - function instead of calculating 11 months back.&lt;/P&gt;&lt;P&gt;Hmm... lets see how i can do that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your fast and fitting response, Rainer!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 15:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/formula-Previous-Year-with-inYearToDate-function/m-p/154076#M30838</guid>
      <dc:creator />
      <dc:date>2010-11-09T15:52:09Z</dc:date>
    </item>
  </channel>
</rss>

