<?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: How to count # of Mondays, Tuesdays etc in any given calendar month. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433656#M485698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have less Surgery Dates than calendar dates, so just using the SurgeryStartDate table might miss some weekdays when doing the weekday aggregation in the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you should prepare a master calendar (there are hundreds of threads, design blogs here in the forum etc how to do this) based on your surgery date field, which contains all calendar dates. Then use this master calendar to create your number-of-weekdays-in-a-month field like suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also change the logic a little to perform a GROUP BY Year, Month, Weekday and do a count of weekdays and set the result into a common field (WeekdaysInYearMonth or similar) which could make it easier to retrieve the number afterwards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2013 08:06:26 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-04-11T08:06:26Z</dc:date>
    <item>
      <title>How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433652#M485694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there an easy way to count up the number of each specific named day in a calendar month?&amp;nbsp; I need to be able to multiply certain numbers by say the number of wednesdays in a month.. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 18:57:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433652#M485694</guid>
      <dc:creator />
      <dc:date>2013-04-08T18:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433653#M485695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work in the script, assuming you have table Calendar with Month, Year, and Date fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JOIN (Calendar) LOAD&lt;BR /&gt; Month,&lt;BR /&gt; Year,&lt;BR /&gt; sum(if(weekday(Date)=&lt;STRONG&gt;0&lt;/STRONG&gt;,1,0) as "# Mondays",&lt;BR /&gt; sum(if(weekday(Date)=&lt;STRONG&gt;1&lt;/STRONG&gt;,1,0) as "# Tuesdays",&lt;BR /&gt; ...&lt;BR /&gt; sum(if(weekday(Date)=&lt;STRONG&gt;6&lt;/STRONG&gt;,1,0) as "# Sundays"&lt;BR /&gt;RESIDENT Calendar&lt;BR /&gt;GROUP BY Month,Year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 19:56:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433653#M485695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-08T19:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433654#M485696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First off, thanks for the response. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually don't have a standalone calendar like that.&amp;nbsp; I'm loading a calendar out of my data warehouse as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SurgeryStartDate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;date&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Date"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'MM/DD/YYYY') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Date"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date CY Year"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date CY Year"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date CY Qtr"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date CY Month"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date FY Year"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date FY Year"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date FY Qtr"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Date FY Month"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Weekday"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Surgery Start Month"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;exists&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Surgery Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;SQL &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;D.FULL_DT AS "Surgery Date",&lt;BR /&gt;D.C_YYYY AS "Surgery Start Date CY Year",&lt;BR /&gt;SUBSTR(D.CY_YYYY_QTR,3,8) AS "Surgery Start Date CY Qtr", &lt;BR /&gt;SUBSTR(D.CY_YYYY_MM_NM,3,9) AS "Surgery Start Date CY Month",&lt;BR /&gt;D.F_YYYY AS "Surgery Start Date FY Year",&lt;BR /&gt;SUBSTR(D.FY_YYYY_QTR,3,8) AS "Surgery Start Date FY Qtr",&lt;BR /&gt;SUBSTR(D.FY_YYYY_MM_NM,3,9) AS "Surgery Start Date FY Month",&lt;BR /&gt;SUBSTR(D.DAY_NM,0,3) AS "Surgery Start Weekday",&lt;BR /&gt;SUBSTR(D.MONTH_NM,0,3) AS "Surgery Start Month"&lt;BR /&gt;FROM CDW.MASTER_DATE D&lt;BR /&gt;JOIN (SELECT MIN(CONTACT_DT_KEY) AS MIN_DT ,MAX(CONTACT_DT_KEY) AS MAX_DT FROM CDW.VISIT WHERE CONTACT_DT_KEY &amp;gt;= 20090701 AND CONTACT_DT_KEY &amp;lt;&amp;gt; 99991231) X1&lt;BR /&gt;ON D.DT_KEY BETWEEN X1.MIN_DT AND X1.MAX_DT; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;So, being a total rookie to this, how would I incorporate your load statement in to that.&amp;nbsp; I can't just call the SurgeryStartdate that I'm using for my load statement can I?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 20:11:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433654#M485696</guid>
      <dc:creator />
      <dc:date>2013-04-10T20:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433655#M485697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the table SurgeryStartDate is your Calendar, and you have Date, Month, and Year, just named differently.&amp;nbsp; Use my logic, replace with your field name and table name, and it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 01:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433655#M485697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-11T01:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433656#M485698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have less Surgery Dates than calendar dates, so just using the SurgeryStartDate table might miss some weekdays when doing the weekday aggregation in the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you should prepare a master calendar (there are hundreds of threads, design blogs here in the forum etc how to do this) based on your surgery date field, which contains all calendar dates. Then use this master calendar to create your number-of-weekdays-in-a-month field like suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also change the logic a little to perform a GROUP BY Year, Month, Weekday and do a count of weekdays and set the result into a common field (WeekdaysInYearMonth or similar) which could make it easier to retrieve the number afterwards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 08:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433656#M485698</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-04-11T08:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433657#M485699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SQL thats pulling together my surgerydate table actually pulls it from my master_date table, which has EVERY date up to like 2029 right now.&amp;nbsp; Maybe I can just count it in the SQL itself instead.. hrm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 17:04:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433657#M485699</guid>
      <dc:creator />
      <dc:date>2013-04-11T17:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433658#M485700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SQL thats pulling together my surgerydate table actually pulls it from my master_date table, which has EVERY date up to like 2029 right now.&amp;nbsp; Maybe I can just count it in the SQL itself instead.. hrm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 17:04:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433658#M485700</guid>
      <dc:creator />
      <dc:date>2013-04-11T17:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433659#M485701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can you try the below code.&lt;/P&gt;&lt;P&gt;Here 'Date' is the Date field which can be any Date so that you can get the Number of Mondays in that month .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to calculate the Tue ,Wed ,Thu , Fri , Sat or Sun&lt;/P&gt;&lt;P&gt;just past instead of&amp;nbsp; 'Mon' in the below code&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; Floor((MonthEnd (Date) - MonthStart(Date) )/7 ) +if(WeekDay( WeekStart(MonthEnd(Date)))='Mon' ,1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If there is anything please let me know .&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 17:55:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433659#M485701</guid>
      <dc:creator />
      <dc:date>2013-04-11T17:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433660#M485702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was a good stab, but its not calculating correctly.&amp;nbsp; I set a variable to equal addmonths(today),-1) and save that to vPriorMonth, which for today's date saves 3/12/13 (since today is 4/12/13).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From there I applied your formula as is, substituting my variable for the Date and it counted that March of 2013 had 5 Mondays, and if set to 'Fri' it says there are 4 Fridays.&amp;nbsp; When looking at a physical calendar its 4 mondays, 5 fridays.&amp;nbsp; Perhaps its not liking the functions in the variable to force it to prior month? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;April 2013&amp;nbsp;&amp;nbsp;&amp;nbsp; = 4 Sun, 5 Mon, 5 Tue, 4 Wed, 4 Thu, 4 Fri, 4 Sat&lt;/P&gt;&lt;P&gt;March 2013 = 5 Sun, 4 Mon, 4 Tue, 4 Wed, 4 Thu, 5 Fri, 5 Sat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's like so close and easy to drop right in to variables... just math is slightly off unless I missed something. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I even went as far as throwing the functions of my variable in to the full function:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;monthend&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(), -1))-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;monthstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(), -1)))/7)+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekday&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekstart&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;monthend&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;addmonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(), -1))))='Fri', 1, 0) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 19:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433660#M485702</guid>
      <dc:creator />
      <dc:date>2013-04-12T19:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433661#M485703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; First use this Set statement in your Script&lt;/P&gt;&lt;P&gt;Set DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you the below code .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt; Floor((MonthEnd (Today()) - MonthStart(Today()) )/7 ) +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; if( num( WeekDay(MonthStart(Today())))+1&amp;lt;= Match('Mon', $(=chr(39) &amp;amp; Replace(DayNames, ';', chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39))) and&amp;nbsp; Match('Mon', $(=chr(39) &amp;amp; Replace(DayNames, ';', chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39))) &amp;lt;=num( WeekDay(MonthEnd(Today())))+1 ,1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you want to count Tuesday then Replace 'Mon' by 'Tue' at 2 places as you can see above .&lt;/P&gt;&lt;P&gt;Use only strings among these&amp;nbsp;&amp;nbsp; Mon,Tue,Wed,Thu,Fri,Sat,Sun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply me for the same .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 21:02:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433661#M485703</guid>
      <dc:creator />
      <dc:date>2013-04-12T21:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433662#M485704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This last iteration worked beautifully.. thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 14:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/433662#M485704</guid>
      <dc:creator />
      <dc:date>2013-04-15T14:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count # of Mondays, Tuesdays etc in any given calendar month.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/1587740#M485705</link>
      <description>&lt;P&gt;The solution is not working properly&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 16:17:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-count-of-Mondays-Tuesdays-etc-in-any-given-calendar-month/m-p/1587740#M485705</guid>
      <dc:creator>NITIN_GUPTA</dc:creator>
      <dc:date>2019-06-03T16:17:07Z</dc:date>
    </item>
  </channel>
</rss>

