<?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: Calculated dimension for YTD, MTD,WTD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1948322#M1219650</link>
    <description>&lt;P&gt;Hi Ashish,&lt;/P&gt;
&lt;P&gt;can you please copy entire script that will helpful for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Vikas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 07:20:38 GMT</pubDate>
    <dc:creator>vikasmahajan</dc:creator>
    <dc:date>2022-06-27T07:20:38Z</dc:date>
    <item>
      <title>Calculated dimension for YTD, MTD,WTD</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587863#M443328</link>
      <description>&lt;P&gt;I want to create a stack bar chart with YTD, MTD, WTD, Prior MTD and Prior YTD,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i was thinking to create the above calculations in the script level and use this in the chart as dimension and it expression simple use =sum(Sales) .&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Development/Calculated-dimension-for-year-to-date/td-p/166510" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Development/Calculated-dimension-for-year-to-date/td-p/166510&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I just saw the above post of Johnw, who explain very well how to create these dimensions, I am following his logic to create these however struggling to create previous MTD and previous YTD.&lt;/P&gt;&lt;P&gt;here is my script;&lt;/P&gt;&lt;P&gt;Dates:&lt;BR /&gt;load Distinct [Order Date] as Date&lt;BR /&gt;Resident Fact;&lt;/P&gt;&lt;P&gt;AsOf:&lt;BR /&gt;load&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'WTD' as "Date Range",&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while week("Date")=week("Date" -IterNo()+1) AND year("Date")=year("Date" -IterNo()+1);&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;LOAD&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'MTD' as "Date Range",&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while month("Date")=month("Date" -IterNo()+1);&lt;/P&gt;&lt;P&gt;//MTD-1 Calculation&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;LOAD&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'MTD-1' as "Date Range",&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while MonthName("Date")-1=MonthName("Date" -IterNo()-1);&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;load&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'YTD' as "Date Range",&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while year("Date")=year("Date" -IterNo()+1);&lt;/P&gt;&lt;P&gt;//YTD-1 Calculation&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;load&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'YTD -1' as "Date Range",&lt;BR /&gt;//MonthName("Date" -iterno()-11) as "Date"&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while year("Date")-1=year("Date" -IterNo()+1);&lt;/P&gt;&lt;P&gt;Drop Table Dates;&lt;/P&gt;&lt;P&gt;In "Date Range" field i am only getting "MTD",'WTD' and "YTD" .&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587863#M443328</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2024-11-16T03:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension for YTD, MTD,WTD</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587947#M443332</link>
      <description>Can u ecplain exact requirement? you want MTD YTD on X axis and sum(Sales according to that ??</description>
      <pubDate>Tue, 04 Jun 2019 08:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587947#M443332</guid>
      <dc:creator>Shubham_Deshmukh</dc:creator>
      <dc:date>2019-06-04T08:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension for YTD, MTD,WTD</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587972#M443333</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Please find the image of the chart i am trying to create. it should have YTD/MTD/Previous YTD and Previous MTD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 09:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1587972#M443333</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-06-04T09:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension for YTD, MTD,WTD</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1588804#M443394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am able to do it using the following code in script;&lt;/P&gt;&lt;P&gt;//MTD-1 Calculation&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;LOAD&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'[MTD-1]' as "Date Range",&lt;BR /&gt;MonthName(Date,-1)as "Date"&lt;BR /&gt;Resident Dates;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//YTD-1 Calculation&lt;/P&gt;&lt;P&gt;Concatenate(AsOf)&lt;BR /&gt;load&lt;BR /&gt;"Date" as "As of Date",&lt;BR /&gt;'[YTD -1]' as "Date Range",&lt;BR /&gt;date("Date" -iterno()+1) as "Date"&lt;BR /&gt;Resident Dates&lt;BR /&gt;while year("Date")-1=year(MonthName("Date",-IterNo()-11));&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 03:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1588804#M443394</guid>
      <dc:creator>ashis</dc:creator>
      <dc:date>2019-06-06T03:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension for YTD, MTD,WTD</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1948322#M1219650</link>
      <description>&lt;P&gt;Hi Ashish,&lt;/P&gt;
&lt;P&gt;can you please copy entire script that will helpful for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Vikas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 07:20:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-for-YTD-MTD-WTD/m-p/1948322#M1219650</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2022-06-27T07:20:38Z</dc:date>
    </item>
  </channel>
</rss>

