<?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 Dynamic Week calculation - YTD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Week-calculation-YTD/m-p/265800#M1204928</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to reaise a dynamic investments dashboard on a weekly basis.&lt;/P&gt;&lt;P&gt;I picked up the formulas from Jason's "YTD calculations using set analysis" and it works well for the current week calculation as I replaced Month by Week.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year))}, Week = {"&amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Week))&amp;gt;$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Week)-1)"}&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for "Previous Week" calculation, a function "addmonths" is used and apparently there is not the same for Week purpose.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year) - $(=if(max(Month) = 1, 1, 0)))}, Month = {$(=month(addmonths(max(MonthYear), -1)))}&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a trick to get through ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jul 2010 10:43:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-07-16T10:43:52Z</dc:date>
    <item>
      <title>Dynamic Week calculation - YTD</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Week-calculation-YTD/m-p/265800#M1204928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to reaise a dynamic investments dashboard on a weekly basis.&lt;/P&gt;&lt;P&gt;I picked up the formulas from Jason's "YTD calculations using set analysis" and it works well for the current week calculation as I replaced Month by Week.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year))}, Week = {"&amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Week))&amp;gt;$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Week)-1)"}&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for "Previous Week" calculation, a function "addmonths" is used and apparently there is not the same for Week purpose.&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=max(Year) - $(=if(max(Month) = 1, 1, 0)))}, Month = {$(=month(addmonths(max(MonthYear), -1)))}&amp;gt;} Field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a trick to get through ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jul 2010 10:43:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Week-calculation-YTD/m-p/265800#M1204928</guid>
      <dc:creator />
      <dc:date>2010-07-16T10:43:52Z</dc:date>
    </item>
  </channel>
</rss>

