<?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: Calculate Easter Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2506811#M1226425</link>
    <description>&lt;P&gt;While this thread is old, the main question remains. I implemented the algorithm described in &lt;A href="http://www.oremus.org/liturgy/etc/ktf/app/easter.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.oremus.org/liturgy/etc/ktf/app/easter.html&lt;/A&gt;&amp;nbsp;below.&lt;BR /&gt;If your goal is to compute net working days, you could add indicators for weekends and public holidays in a&amp;nbsp;&lt;SPAN&gt;Master Calendar, and compute the sum of these days between the dates of interest.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;// Compute Easter Sunday. Apparently, QLik Sense does not provide this info.
//
// Useful links
// https://www.oremus.org/liturgy/etc/ktf/app/easter.html
// https://almanac.oremus.org/easter/computus/
// https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/dollar-sign-expansion-using-parameters.htm



// We refer to the year number as y (or $1), and use it to calculate the
// g: Golden number
Set GoldenNumber = '(Mod($1, 19) + 1)';

// s: solar correction
// l: lunar correction
Set SolarCorrection= 'Floor(($1-1600)/100) - Floor(($1-1600)/400)';
Set LunarCorrection = 'Floor(((Floor(($1-1400)/100))*8)/25)';

// p': Next we calculate the date of the Paschal full moon, that is, the full moon which Easter is the Sunday after. This is done in several stages.
Set Paschal_uncorr = 'Mod(3 - 11*$(GoldenNumber($1)) + $(SolarCorrection($1)) - $(LunarCorrection($1)), 30)';

// p: Paschal full moon (as the number of days after 21st March)
// apply a minor correction to get the exact date of the Paschal full moon (as the number of days after 21st March)
Set Paschal = 'If($(Paschal_uncorr($1)) = 29 or ($(Paschal_uncorr($1)) = 28 and $(GoldenNumber($1)) &amp;gt; 11), $(Paschal_uncorr($1))-1, $(Paschal_uncorr($1)))';

// d: calculate the 'Dominical number'
// Note that this is the number from which the Dominical letter is determined
Set DominicalNumber = 'Mod($1 + Floor($1/4) - Floor($1/100) + Floor($1/400),7)';

// d': which is the date on which the first Sunday of the year falls
Set FirstSunday = 'Mod(8-$(DominicalNumber($1)), 7)';

// p'': the first date in the year which falls on the same day of the week as the Paschal full moon.
Set FirstDay = 'Mod(31 + 28 + 21 + $(Paschal($1)), 7)';

// x = difference between d' (the first Sunday in the year) and p'' (the day of the week when the Paschal full moon falls)
// with minor correction so that x falls within the range 1-7 instead of 0-6
Set SundayDiff = '(Mod($(FirstSunday($1)) - $(FirstDay($1)) - 1, 7) + 1)';

// number of days Easter falls after 21st March:
Set EasterOffset = '$(Paschal($1)) + $(SundayDiff($1))';

Set Easter = 'Date(MakeDate($1, 3, 21) + $(EasterOffset($1)))';


Let y = Year(Today());
Let g = $(GoldenNumber(Year(Today())));
Let s = $(SolarCorrection(Year(Today())));
Let l = $(LunarCorrection(Year(Today())));
Let p_prime = $(Paschal_uncorr(Year(Today())));
Let p = $(Paschal(Year(Today())));
Let d = $(DominicalNumber(Year(Today())));
Let d_prime = $(FirstSunday(Year(Today())));
Let p_dblprime = $(FirstDay(Year(Today())));
Let x = $(SundayDiff(Year(Today())));
Let e = $(EasterOffset(Year(Today())));

Let Easter_2024 = $(Easter(Year(Today())-1));
Let Easter_ThisYear = $(Easter(Year(Today())));
Let Easter_2026 = $(Easter(2026));
Let Easter_2027 = $(Easter(2027));
Let Easter_2028 = $(Easter(2028));
Let Easter_2029 = $(Easter(2029));

trace &amp;gt;&amp;gt;&amp;gt; Year = $(y);
trace &amp;gt;&amp;gt;&amp;gt; GoldenNumber($(y)) = $(g);
trace &amp;gt;&amp;gt;&amp;gt; SolarCorrection($(y)) = $(s);
trace &amp;gt;&amp;gt;&amp;gt; LunarCorrection($(y)) = $(l);
trace &amp;gt;&amp;gt;&amp;gt; Paschal_uncorr($(y)) = $(p_prime);
trace &amp;gt;&amp;gt;&amp;gt; Paschal($(y)) = $(p);
trace &amp;gt;&amp;gt;&amp;gt; DominicalNumber($(y)) = $(d);
trace &amp;gt;&amp;gt;&amp;gt; FirstSunday($(y)) = $(d_prime);
trace &amp;gt;&amp;gt;&amp;gt; FirstDay($(y)) = $(p_dblprime);
trace &amp;gt;&amp;gt;&amp;gt; SundayDiff($(y)) = $(x);
trace &amp;gt;&amp;gt;&amp;gt; EasterOffset($(y)) = $(e);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2024) = $(Easter_2024);
trace &amp;gt;&amp;gt;&amp;gt; Easter($(y)) = $(Easter_ThisYear);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2026) = $(Easter_2026);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2027) = $(Easter_2027);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2028) = $(Easter_2028);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2029) = $(Easter_2029);

Let y = NULL();
Let g = NULL();
Let s = NULL();
Let l = NULL();
Let p_prime = NULL();
Let p = NULL();
Let d = NULL();
Let d_prime = NULL();
Let p_dblprime = NULL();
Let x = NULL();
Let e = NULL();
Let Easter_2024 = NULL();
Let Easter_ThisYear = NULL();
Let Easter_2026 = NULL();
Let Easter_2027= NULL();
Let Easter_2028 = NULL();
Let Easter_2029 = NULL();


&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2025 15:09:20 GMT</pubDate>
    <dc:creator>Gaël</dc:creator>
    <dc:date>2025-02-20T15:09:20Z</dc:date>
    <item>
      <title>Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222839#M624883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Is there a way to calculate automatically Easter dates for every year (in past and in future)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 14:04:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222839#M624883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-09T14:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222840#M624884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may be possible to build the calculation in the script.&amp;nbsp; Or iIf you just need the actual dates, you can download them from a site on the web. Google "Easter dates" and find a suitable source. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 15:59:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222840#M624884</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2016-11-09T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222841#M624885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look here: &lt;A href="https://community.qlik.com/docs/DOC-14220"&gt;Master Calendar with movable holidays&lt;/A&gt; which includes a calculation of the easter dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 16:09:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/1222841#M624885</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-11-09T16:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451210#M1225676</link>
      <description>&lt;P&gt;Hello Marcus and everyone! The link to the Master Calendar with movable holidays is dead now. Can we find it somewhere else?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 15:26:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451210#M1225676</guid>
      <dc:creator>amonjaras_c40</dc:creator>
      <dc:date>2024-05-10T15:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451663#M1225678</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/60553"&gt;@Sue_Macaluso&lt;/a&gt;&amp;nbsp;- please make my previous blog-postings accessible again. Many thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:59:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451663#M1225678</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-05-13T09:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451667#M1225679</link>
      <description>&lt;P&gt;&lt;A href="http://www.oremus.org/liturgy/etc/ktf/app/easter.html" target="_blank"&gt;http://www.oremus.org/liturgy/etc/ktf/app/easter.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There's a calculation explained.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 10:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2451667#M1225679</guid>
      <dc:creator>HoS1</dc:creator>
      <dc:date>2024-05-13T10:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Easter Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2506811#M1226425</link>
      <description>&lt;P&gt;While this thread is old, the main question remains. I implemented the algorithm described in &lt;A href="http://www.oremus.org/liturgy/etc/ktf/app/easter.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.oremus.org/liturgy/etc/ktf/app/easter.html&lt;/A&gt;&amp;nbsp;below.&lt;BR /&gt;If your goal is to compute net working days, you could add indicators for weekends and public holidays in a&amp;nbsp;&lt;SPAN&gt;Master Calendar, and compute the sum of these days between the dates of interest.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;// Compute Easter Sunday. Apparently, QLik Sense does not provide this info.
//
// Useful links
// https://www.oremus.org/liturgy/etc/ktf/app/easter.html
// https://almanac.oremus.org/easter/computus/
// https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/dollar-sign-expansion-using-parameters.htm



// We refer to the year number as y (or $1), and use it to calculate the
// g: Golden number
Set GoldenNumber = '(Mod($1, 19) + 1)';

// s: solar correction
// l: lunar correction
Set SolarCorrection= 'Floor(($1-1600)/100) - Floor(($1-1600)/400)';
Set LunarCorrection = 'Floor(((Floor(($1-1400)/100))*8)/25)';

// p': Next we calculate the date of the Paschal full moon, that is, the full moon which Easter is the Sunday after. This is done in several stages.
Set Paschal_uncorr = 'Mod(3 - 11*$(GoldenNumber($1)) + $(SolarCorrection($1)) - $(LunarCorrection($1)), 30)';

// p: Paschal full moon (as the number of days after 21st March)
// apply a minor correction to get the exact date of the Paschal full moon (as the number of days after 21st March)
Set Paschal = 'If($(Paschal_uncorr($1)) = 29 or ($(Paschal_uncorr($1)) = 28 and $(GoldenNumber($1)) &amp;gt; 11), $(Paschal_uncorr($1))-1, $(Paschal_uncorr($1)))';

// d: calculate the 'Dominical number'
// Note that this is the number from which the Dominical letter is determined
Set DominicalNumber = 'Mod($1 + Floor($1/4) - Floor($1/100) + Floor($1/400),7)';

// d': which is the date on which the first Sunday of the year falls
Set FirstSunday = 'Mod(8-$(DominicalNumber($1)), 7)';

// p'': the first date in the year which falls on the same day of the week as the Paschal full moon.
Set FirstDay = 'Mod(31 + 28 + 21 + $(Paschal($1)), 7)';

// x = difference between d' (the first Sunday in the year) and p'' (the day of the week when the Paschal full moon falls)
// with minor correction so that x falls within the range 1-7 instead of 0-6
Set SundayDiff = '(Mod($(FirstSunday($1)) - $(FirstDay($1)) - 1, 7) + 1)';

// number of days Easter falls after 21st March:
Set EasterOffset = '$(Paschal($1)) + $(SundayDiff($1))';

Set Easter = 'Date(MakeDate($1, 3, 21) + $(EasterOffset($1)))';


Let y = Year(Today());
Let g = $(GoldenNumber(Year(Today())));
Let s = $(SolarCorrection(Year(Today())));
Let l = $(LunarCorrection(Year(Today())));
Let p_prime = $(Paschal_uncorr(Year(Today())));
Let p = $(Paschal(Year(Today())));
Let d = $(DominicalNumber(Year(Today())));
Let d_prime = $(FirstSunday(Year(Today())));
Let p_dblprime = $(FirstDay(Year(Today())));
Let x = $(SundayDiff(Year(Today())));
Let e = $(EasterOffset(Year(Today())));

Let Easter_2024 = $(Easter(Year(Today())-1));
Let Easter_ThisYear = $(Easter(Year(Today())));
Let Easter_2026 = $(Easter(2026));
Let Easter_2027 = $(Easter(2027));
Let Easter_2028 = $(Easter(2028));
Let Easter_2029 = $(Easter(2029));

trace &amp;gt;&amp;gt;&amp;gt; Year = $(y);
trace &amp;gt;&amp;gt;&amp;gt; GoldenNumber($(y)) = $(g);
trace &amp;gt;&amp;gt;&amp;gt; SolarCorrection($(y)) = $(s);
trace &amp;gt;&amp;gt;&amp;gt; LunarCorrection($(y)) = $(l);
trace &amp;gt;&amp;gt;&amp;gt; Paschal_uncorr($(y)) = $(p_prime);
trace &amp;gt;&amp;gt;&amp;gt; Paschal($(y)) = $(p);
trace &amp;gt;&amp;gt;&amp;gt; DominicalNumber($(y)) = $(d);
trace &amp;gt;&amp;gt;&amp;gt; FirstSunday($(y)) = $(d_prime);
trace &amp;gt;&amp;gt;&amp;gt; FirstDay($(y)) = $(p_dblprime);
trace &amp;gt;&amp;gt;&amp;gt; SundayDiff($(y)) = $(x);
trace &amp;gt;&amp;gt;&amp;gt; EasterOffset($(y)) = $(e);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2024) = $(Easter_2024);
trace &amp;gt;&amp;gt;&amp;gt; Easter($(y)) = $(Easter_ThisYear);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2026) = $(Easter_2026);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2027) = $(Easter_2027);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2028) = $(Easter_2028);
trace &amp;gt;&amp;gt;&amp;gt; Easter(2029) = $(Easter_2029);

Let y = NULL();
Let g = NULL();
Let s = NULL();
Let l = NULL();
Let p_prime = NULL();
Let p = NULL();
Let d = NULL();
Let d_prime = NULL();
Let p_dblprime = NULL();
Let x = NULL();
Let e = NULL();
Let Easter_2024 = NULL();
Let Easter_ThisYear = NULL();
Let Easter_2026 = NULL();
Let Easter_2027= NULL();
Let Easter_2028 = NULL();
Let Easter_2029 = NULL();


&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 15:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Easter-Dates/m-p/2506811#M1226425</guid>
      <dc:creator>Gaël</dc:creator>
      <dc:date>2025-02-20T15:09:20Z</dc:date>
    </item>
  </channel>
</rss>

