<?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: Generic holiday mapping in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80041#M13177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Peter is right and there are various differences between the calendars. If you ever need more to this topic take a look here: &lt;A href="https://community.qlik.com/qlik-blogpost/4898"&gt;Non-Gregorian calendars&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2018 05:02:41 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2018-05-25T05:02:41Z</dc:date>
    <item>
      <title>Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80036#M13172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;!So, checking out the various holiday discussions, I noticed that holidays are nothing&lt;/P&gt;&lt;P&gt;more than a date pattern.&amp;nbsp; For example, christmas is always the 25th so will always be one of the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mon Dec25,Christmas&lt;/P&gt;&lt;P&gt;Tue Dec25,Christmas&lt;/P&gt;&lt;P&gt;Wed Dec25,Christmas&lt;/P&gt;&lt;P&gt;Tbu Dec25,Christmas&lt;/P&gt;&lt;P&gt;Fri Dec25,Christmas&lt;/P&gt;&lt;P&gt;Mon Dec26,Christmas&lt;/P&gt;&lt;P&gt;Mon Dec27,Christmas&lt;/P&gt;&lt;P&gt;Note : last two are when the holiday falls on the weekend&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Floating holidays have a slightly different pattern.&amp;nbsp; In the US, memorial day is the last Monday in May&lt;/P&gt;&lt;P&gt;or put another way, memorial day occurs during the the last 7 days of May which means its one of the following&lt;/P&gt;&lt;P&gt;Mon May25,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May26,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May27,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May28,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May29,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May30,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May31,Memorial Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's no need to check the year because the pattern is independent of the year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I create my master calendar, I simply use this mapping table for the six US holidays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAPPING_TO_HOLIDAY:&lt;/P&gt;&lt;P&gt;MAPPING LOAD * INLINE [&lt;/P&gt;&lt;P&gt;DatePattern,Holiday&lt;/P&gt;&lt;P&gt;Mon Jan1,New Years&lt;/P&gt;&lt;P&gt;Tue Jan1,New Years&lt;/P&gt;&lt;P&gt;Wed Jan1,New Years&lt;/P&gt;&lt;P&gt;Tbu Jan1,New Years&lt;/P&gt;&lt;P&gt;Fri Jan1,New Years&lt;/P&gt;&lt;P&gt;Mon Jan2,New Years&lt;/P&gt;&lt;P&gt;Mon Jan3,New Years&lt;/P&gt;&lt;P&gt;Mon May25,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May26,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May27,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May28,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May29,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May30,Memorial Day&lt;/P&gt;&lt;P&gt;Mon May31,Memorial Day&lt;/P&gt;&lt;P&gt;Mon Jul4,Independence Day&lt;/P&gt;&lt;P&gt;Tue Jul4,Independence Day&lt;/P&gt;&lt;P&gt;Wed Jul4,Independence Day&lt;/P&gt;&lt;P&gt;Tbu Jul4,Independence Day&lt;/P&gt;&lt;P&gt;Fri Jul4,Independence Day&lt;/P&gt;&lt;P&gt;Mon Jul5,Independence Day&lt;/P&gt;&lt;P&gt;Mon Jul6,Independence Day&lt;/P&gt;&lt;P&gt;Mon Sep1,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep2,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep3,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep4,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep5,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep6,Labor Day&lt;/P&gt;&lt;P&gt;Mon Sep7,Labor Day&lt;/P&gt;&lt;P&gt;Thu Nov22,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov23,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov24,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov25,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov26,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov27,Thanksgiving&lt;/P&gt;&lt;P&gt;Thu Nov28,Thanksgiving&lt;/P&gt;&lt;P&gt;Mon Dec25,Christmas&lt;/P&gt;&lt;P&gt;Tue Dec25,Christmas&lt;/P&gt;&lt;P&gt;Wed Dec25,Christmas&lt;/P&gt;&lt;P&gt;Tbu Dec25,Christmas&lt;/P&gt;&lt;P&gt;Fri Dec25,Christmas&lt;/P&gt;&lt;P&gt;Mon Dec26,Christmas&lt;/P&gt;&lt;P&gt;Mon Dec27,Christmas&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use the following in the master calendar load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPLYMAP('MAPPING_TO_HOLIDAY',TEXT(DATE(tempdate,'WWW MMMD')),'N/A') AS Holiday&lt;/P&gt;&lt;P&gt;Note: update from OP.&amp;nbsp; Need TEXT function because the mapping is string based.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried this with most of the US holidays and it works better than expected.&lt;/P&gt;&lt;P&gt;Easter is a bit of a challenge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any comments if I missed something.&amp;nbsp; Happy Qliking&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached a sample document based on Michael's post&amp;nbsp; &lt;A href="https://community.qlik.com/docs/DOC-5741"&gt;Calculating Holidays in script&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Added feature:&lt;/P&gt;&lt;P&gt;- Observed vs Actual holiday&lt;/P&gt;&lt;P&gt;- Ability to add holidays for other countries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 12:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80036#M13172</guid>
      <dc:creator>markp201</dc:creator>
      <dc:date>2018-05-23T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80037#M13173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easter sunday could be calculated and various related holidays could then be generated with a simple offset of n-days of it. How it could be calculated and also be implemented (with a mapping too) could you find here: &lt;A href="https://community.qlik.com/docs/DOC-14220"&gt;Master Calendar with movable holidays&lt;/A&gt;.&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, 23 May 2018 13:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80037#M13173</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-23T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80038#M13174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still researching but I believe Easter is dependent on Christmas of the previous year.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Another advantage is setting up observed vs. actual holidays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mon Jan1,New Years&lt;/P&gt;&lt;P&gt;Tue Jan1,New Years&lt;/P&gt;&lt;P&gt;Wed Jan1,New Years&lt;/P&gt;&lt;P&gt;Thu Jan1,New Years&lt;/P&gt;&lt;P&gt;Fri Jan1,New Years&lt;/P&gt;&lt;P&gt;Sat Jan1,New Years&lt;/P&gt;&lt;P&gt;Sun Jan1,New Years&lt;/P&gt;&lt;P&gt;Mon Jan3,New Years Observed&lt;/P&gt;&lt;P&gt;Mon Jan2,News Years Observed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 17:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80038#M13174</guid>
      <dc:creator>markp201</dc:creator>
      <dc:date>2018-05-24T17:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80039#M13175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK it's not (directly) related to christmas else (if I remember correctly) it's the first sunday after the first full moon after the first day of the spring and therefore it changed with each year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 17:40:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80039#M13175</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-24T17:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80040#M13176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And even then, there is a difference between the Western Christian calendar (Gregorian calendar) and the Eastern Christian Calendar (Julian calendar) which made Easter in Greece fall this year exactly one week after Easter in most other countries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 22:13:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80040#M13176</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2018-05-24T22:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generic holiday mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80041#M13177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Peter is right and there are various differences between the calendars. If you ever need more to this topic take a look here: &lt;A href="https://community.qlik.com/qlik-blogpost/4898"&gt;Non-Gregorian calendars&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2018 05:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-holiday-mapping/m-p/80041#M13177</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-25T05:02:41Z</dc:date>
    </item>
  </channel>
</rss>

