<?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 Master Calendar Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Master-Calendar-Script/m-p/1279851#M861295</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've seen many users here asking the questions about how to get previous month, week, year, quarter data.&lt;/P&gt;&lt;P&gt;This can be done directly into the Master calendar to avoid any confusion when writing a set expression and getting it wrong.&lt;/P&gt;&lt;P&gt;We can simply create flags for each field and use it in our front end as ....Flag={1}........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching the Master Calendar script I've created to do same and it might be helpful for others to just use &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum({&amp;lt;LastMonthFlag={1}}&amp;gt;}Sales) &lt;/SPAN&gt; rather than using&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum({&amp;lt;Month={$(=Month(AddMonths(Max(Date),-1)))}&amp;gt;}Sales) to get previous month's sale.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;It also has Last quarter flags, Last month last per quarter flag, last year flag, current quarter, current month, weekend dates etc....&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I edited this script as I wanted to skip those long syntax used in Set Analysis to get previous month/year.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;All you need to do is copy the script as it is from the attached document and run it. And DateID will be your key matching to your Fact Dates, hence you need to convert the dates in your fact to same format as DateID from Master to link it.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;You're welcome to add anything extra to it/find an error in the attached script.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>MK9885</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Master Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-Script/m-p/1279851#M861295</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've seen many users here asking the questions about how to get previous month, week, year, quarter data.&lt;/P&gt;&lt;P&gt;This can be done directly into the Master calendar to avoid any confusion when writing a set expression and getting it wrong.&lt;/P&gt;&lt;P&gt;We can simply create flags for each field and use it in our front end as ....Flag={1}........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching the Master Calendar script I've created to do same and it might be helpful for others to just use &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum({&amp;lt;LastMonthFlag={1}}&amp;gt;}Sales) &lt;/SPAN&gt; rather than using&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum({&amp;lt;Month={$(=Month(AddMonths(Max(Date),-1)))}&amp;gt;}Sales) to get previous month's sale.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;It also has Last quarter flags, Last month last per quarter flag, last year flag, current quarter, current month, weekend dates etc....&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I edited this script as I wanted to skip those long syntax used in Set Analysis to get previous month/year.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;All you need to do is copy the script as it is from the attached document and run it. And DateID will be your key matching to your Fact Dates, hence you need to convert the dates in your fact to same format as DateID from Master to link it.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;You're welcome to add anything extra to it/find an error in the attached script.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks.&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/Master-Calendar-Script/m-p/1279851#M861295</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar Script</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-Script/m-p/1520214#M861296</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is really helpful to everyone. Just one suggestion instead of posting your document as question in this group, you can post it in QilkView Docuement path. So that If any one want to refer it he / she will search in document tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant Sangle&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 08:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-Script/m-p/1520214#M861296</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2018-12-13T08:58:33Z</dc:date>
    </item>
  </channel>
</rss>

