<?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: MTD calculation- Need help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369857#M839970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the below code with the concept of As Of table&amp;nbsp; and I can't calculate MTD using script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;tmpAsOfCalendar:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Data]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; (tmpAsOfCalendar)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; tmpAsOfCalendar;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[As-Of Calendar]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; *,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Day',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Day')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Week',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Week')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagWeek&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), 'Previous Month',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), 'Current Month')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, 1,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMTD&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Year',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Year')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDateMonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; =0, 1 ,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMTD2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DateKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfCalDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,'YYYYMM') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;('QuartersMap', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Null&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;()) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Quarter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;MonthsStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDateMonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; -&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;MonthsStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Round&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;WeekStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;WeekStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;))/7) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)*12 + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) - (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)*12 + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; tmpAsOfCalendar &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; tmpAsOfCalendar; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please help me&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 May 2017 09:49:31 GMT</pubDate>
    <dc:creator>ananyaghosh</dc:creator>
    <dc:date>2017-05-06T09:49:31Z</dc:date>
    <item>
      <title>MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369849#M839962</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 am attaching a sample data source and I need MTD calculation Set expression.&lt;/P&gt;&lt;P&gt;I amusing the below expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;sum(&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;&lt;STRONG style="font-family: inherit; font-size: 13.33px; font-style: inherit;"&gt;{&amp;lt;date=,Year=,Month=,Quarter=, &lt;SPAN style="color: #339966; font-family: Calibri, sans-serif; font-size: 11pt; font-style: inherit; font-weight: inherit;"&gt;date={"&amp;gt;=$(=&lt;SPAN style="color: #ff0000; font-family: inherit; font-size: 14.66px; font-style: inherit; font-weight: inherit;"&gt;Month&lt;/SPAN&gt;Start(Max(date)))&amp;lt;=$(=Max(date))"}&lt;/SPAN&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;Sales)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;and have added &lt;STRONG&gt;date as dimension.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;but, it show &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt; me &lt;STRONG&gt;only corresponding date's value, not the accumulated value from month start date to corresponding date value.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;So, if 1/1/2015 have value 10 and 1/12/2015 have value 20,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt; then it show &lt;STRONG&gt;30 for 1/12/2015.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;Any help will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; font-size: 13.33px; font-style: inherit; font-weight: inherit;"&gt;Sandip&lt;/SPAN&gt;&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/MTD-calculation-Need-help/m-p/1369849#M839962</guid>
      <dc:creator>ananyaghosh</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369850#M839963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sandip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer below link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-17974"&gt;Date Level Analysis - WTD, MTD, QTD &amp;amp;amp; YTD (Current Year &amp;amp;amp; Previous Year)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 07:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369850#M839963</guid>
      <dc:creator>rahulpawarb</dc:creator>
      <dc:date>2017-05-05T07:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369851#M839964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can see from my post that their expression does not work for me if i select (order date) as dimension and if i select other collumn as dimension it just show the last year's value along with previos year's value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to solve this situation.&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 09:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369851#M839964</guid>
      <dc:creator>ananyaghosh</dc:creator>
      <dc:date>2017-05-05T09:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369852#M839965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer attached sample application. If you are still facing issue then let me know...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 09:50:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369852#M839965</guid>
      <dc:creator>rahulpawarb</dc:creator>
      <dc:date>2017-05-05T09:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369853#M839966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;As i am using the qlikvuew personal edition, i cannot open your qvw file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please give me the script and dimension name and set expression used for it.&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 13:21:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369853#M839966</guid>
      <dc:creator>ananyaghosh</dc:creator>
      <dc:date>2017-05-05T13:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369854#M839967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Can u give me the script? Along with dimensiob and expressions?&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 17:35:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369854#M839967</guid>
      <dc:creator>ananyaghosh</dc:creator>
      <dc:date>2017-05-05T17:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369855#M839968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Remove First 'date=' from your expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit; color: #3d3d3d;"&gt;sum(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.33px; font-family: inherit;"&gt;{&amp;lt;Year=,Month=,Quarter=, &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11pt; font-family: Calibri, sans-serif; color: #339966;"&gt;date={"&amp;gt;=$(=&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 14.66px; font-family: inherit; color: #ff0000;"&gt;Month&lt;/SPAN&gt;Start(Max(date)))&amp;lt;=$(=Max(date))"}&lt;/SPAN&gt;&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit; color: #3d3d3d;"&gt;Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 19:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369855#M839968</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2017-05-05T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369856#M839969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also you can use 'Full Accumulation' option in the expression properties.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162388_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 19:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369856#M839969</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2017-05-05T19:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: MTD calculation- Need help</title>
      <link>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369857#M839970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the below code with the concept of As Of table&amp;nbsp; and I can't calculate MTD using script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;tmpAsOfCalendar:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Data]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; (tmpAsOfCalendar)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; tmpAsOfCalendar;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[As-Of Calendar]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; *,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Day',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Day')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Week',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Week')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagWeek&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), 'Previous Month',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), 'Current Month')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, 1,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMTD&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=0,'Current Year',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;=1,'Previous Year')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDateMonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; =0, 1 ,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;FlagMTD2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DateKey&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfCalDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,'YYYYMM') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;('QuartersMap', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Null&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;()) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Quarter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;DayDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;MonthsStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDateMonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; -&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;MonthsStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[AsOfDate]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthStartToDateDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Round&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;WeekStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;WeekStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;))/7) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;WeekDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&amp;nbsp; &lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)*12 + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) - (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)*12 + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;MonthDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;YearDiff&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; tmpAsOfCalendar &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;AsOfDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; tmpAsOfCalendar; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please help me&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2017 09:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MTD-calculation-Need-help/m-p/1369857#M839970</guid>
      <dc:creator>ananyaghosh</dc:creator>
      <dc:date>2017-05-06T09:49:31Z</dc:date>
    </item>
  </channel>
</rss>

