<?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: Fiscal Month Start in Expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928012#M76427</link>
    <description>&lt;P&gt;Thanks for the suggestions:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use a combination of those already - This 1st script is my standard calendar I use where months normally start on the 1st of the month. Works very well for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[$(_calendar)]:&lt;BR /&gt;LOAD&lt;BR /&gt;[$(_field)]&lt;BR /&gt;,YearName([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearName]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1) as [$(_prefix)Year]&lt;BR /&gt;,Month([$(_field)]) as [$(_prefix)Month]&lt;BR /&gt;,date(monthstart([$(_field)])) as [$(_prefix)MonthStart]&lt;BR /&gt;,date(monthend([$(_field)])) as [$(_prefix)MonthEnd]&lt;BR /&gt;,YearStart([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearStart]&lt;BR /&gt;,YearEnd([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearEnd]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp;'Q' &amp;amp; Ceil(Month(addmonths(addyears([$(_field)],1),-2)) / 3) as [$(_prefix)YearQuarter]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp; Num(Mod(Month([$(_field)]) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)YearPeriod]&lt;BR /&gt;,inmonthtodate ([$(_field)], Today(), 0, $(FirstMonthOfYear) ) as [$(_prefix)inMTD]&lt;BR /&gt;,inmonthtodate ([$(_field)], Today(), -1, $(FirstMonthOfYear) ) as [$(_prefix)inPMTD]&lt;BR /&gt;,inyeartodate ([$(_field)], Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inYTD]&lt;BR /&gt;,inyeartodate ([$(_field)], Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPYTD]&lt;BR /&gt;,inquartertodate ([$(_field)], Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inQTD]&lt;BR /&gt;,Num(Mod(Month([$(_field)]) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)Period]&lt;BR /&gt;,'Q' &amp;amp; CEIL(MONTH(addmonths(addyears([$(_field)],1),-2)) / 3) as [$(_prefix)Quarter]&lt;BR /&gt;,Div([$(_field)]-YearStart([$(_field)],0,$(FirstMonthOfYear)),7)+1 as [$(_prefix)Week]&lt;BR /&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;BR /&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;BR /&gt;,MonthName([$(_field)]) as [$(_prefix)MonthYear]&lt;BR /&gt;,Year([$(_field)])*12 + Month([$(_field)]) as [$(_prefix)BaseMonth]&lt;BR /&gt;;&lt;BR /&gt;// Generate range of dates between min and max.&lt;BR /&gt;LOAD&lt;BR /&gt;date(DateMin + IterNo()) as [$(_field)]&lt;BR /&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax &lt;BR /&gt;;&lt;BR /&gt;// Find min and max of date field values.&lt;BR /&gt;LOAD&lt;BR /&gt;min(datefield)-1 as DateMin&lt;BR /&gt;,max(datefield) as DateMax&lt;BR /&gt;;&lt;BR /&gt;// Load date field values.&lt;BR /&gt;LOAD &lt;BR /&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;BR /&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;
&lt;P&gt;I am also ok with this results of the below calendar. The fundemental issue I am having is in the expression where I need to show the MTD values of the last 12 Fisc months. The expression shared at first is works when the month starts on the first. I cannot get it to work however when the fisc month starts on the 26th.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[$(_calendar)]:&lt;BR /&gt;LOAD&lt;BR /&gt;//Fiscal Calendar based on mid month start&lt;BR /&gt;*&lt;BR /&gt;,YearName(FiscalDate,0,$(FirstMonthOfYear)) as [$(_prefix)YearName]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1) as [$(_prefix)Year]&lt;BR /&gt;,Month(monthstart(FiscalDate-$(LastDayofFiscYear),1)) as [$(_prefix)Month]&lt;/P&gt;
&lt;P&gt;,if(month(FiscalDate) &amp;gt; 2,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))), Num(Month(FiscalDate)-1),$(LastDayofFiscYear)+1)&lt;BR /&gt;, if(Month(FiscalDate)&amp;gt;1, MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1), Num(Month(FiscalDate)-1 ),$(LastDayofFiscYear)+1)&lt;BR /&gt;, MakeDate((Year(YearStart(FiscalDate,0, $(FirstMonthOfYear)))), 12, $(LastDayofFiscYear)+1))) as [$(_prefix)MonthStart]&lt;BR /&gt;&lt;BR /&gt;,if(month(FiscalDate) &amp;gt; 2, MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))), Num(Month(FiscalDate)),$(LastDayofFiscYear))&lt;BR /&gt;,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1), Num(Month(FiscalDate)),$(LastDayofFiscYear))) as [$(_prefix)MonthEnd]&lt;BR /&gt;,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)+1) as [$(_prefix)YearStart]&lt;BR /&gt;,MakeDate((Year(YearEnd(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)) as [$(_prefix)YearEnd]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp;'Q' &amp;amp; Ceil(Month(addmonths(addyears(FiscalDate,1),-2)) / 3) as [$(_prefix)YearQuarter] &lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp; Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)YearPeriod] &lt;BR /&gt;,inmonthtodate(FiscalDate, Today(), 0, $(FirstMonthOfYear) ) as [$(_prefix)inMTD]&lt;BR /&gt;,inmonthtodate(FiscalDate, Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPMTD] &lt;BR /&gt;,inyeartodate(FiscalDate, Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inYTD]&lt;BR /&gt;,inyeartodate(FiscalDate, Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPYTD]&lt;BR /&gt;,inquartertodate(FiscalDate, Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inQTD]&lt;BR /&gt;,Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)Period]&lt;BR /&gt;,'Q' &amp;amp; CEIL(MONTH(addmonths(addyears(FiscalDate,1),-2)) / 3) as [$(_prefix)Quarter]&lt;BR /&gt;,Div([$(_field)]-MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)+1),7)+1 as [$(_prefix)Week]&lt;BR /&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;BR /&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;BR /&gt;,MonthName([$(_field)]) as [$(_prefix)MonthYear]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear))) )*12 + Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)_BaseMonth]&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;// Use FiscalDate in Fiscal Calendar ONLY - Can drop after loading calendar&lt;BR /&gt;Date(monthstart([$(_field)]-$(LastDayofFiscYear),1)) as FiscalDate,&lt;BR /&gt;[$(_field)]&lt;BR /&gt;;&lt;BR /&gt;// Generate range of dates between min and max.&lt;BR /&gt;LOAD&lt;BR /&gt;date(DateMin + IterNo()) as [$(_field)]&lt;BR /&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax &lt;BR /&gt;;&lt;BR /&gt;// Find min and max of date field values.&lt;BR /&gt;LOAD&lt;BR /&gt;min(datefield)-1 as DateMin&lt;BR /&gt;,max(datefield) as DateMax&lt;BR /&gt;;&lt;BR /&gt;// Load date field values.&lt;BR /&gt;LOAD &lt;BR /&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;BR /&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;
&lt;P&gt;Thank you for actually making the suggestion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2022 13:26:05 GMT</pubDate>
    <dc:creator>johngouws</dc:creator>
    <dc:date>2022-05-09T13:26:05Z</dc:date>
    <item>
      <title>Fiscal Month Start in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1927865#M76422</link>
      <description>&lt;P&gt;Good morning. &lt;BR /&gt;I am asking for assistance with something that has occupied a few days of my time! &lt;BR /&gt;I have a field in my calendar called BaseMonth. I use it for quite a few things. Unfortunately I need to find a way of using it, or else something similar, in a App with a fisc Calendar where the first day of the month is the 26th.&lt;/P&gt;
&lt;P&gt;Something else in the expression is that it returns the MTD values for the past 12 months. &lt;BR /&gt;In the included snippet this first object shows how it will normally work when the month starts on the 1st of the month. As today is the 9th the yellow highlights shows all the previous months to the same date.&lt;/P&gt;
&lt;P&gt;What I am struggling with is the center object. The Mass value since the 1st day of the Fisc month, 26th to month end, should be included in the second column. I should then have the same layout as the 1st object but the Dates will range from the 26th to the 9th for each BaseMonth.&lt;/P&gt;
&lt;P&gt;Below is the Calendar script and expression I normally use.&lt;/P&gt;
&lt;P&gt;When Mth Start on 1st &lt;BR /&gt;BaseMonth Calendar script: &lt;BR /&gt;Year(Date)*12 + Month(Date) as [BaseMonth]&lt;/P&gt;
&lt;P&gt;Expression: &lt;BR /&gt;sum({$&amp;lt;[Year]=,[Period]=,Quarter=,Month=&lt;BR /&gt;,Day={"&amp;lt;=$(=day(Today()))&amp;gt;=$(=day(monthstart(Today())) )"}&lt;BR /&gt;,BaseMonth={"&amp;gt;=$(=(Year(Today())*12 + Month(Today())-13) )"}&lt;BR /&gt;&amp;gt;} Mass)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When Mth Start on 26th &lt;BR /&gt;BaseMonth Fiscal Calendar script: &lt;BR /&gt;(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear))) )*12 + Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [BaseMonth]&lt;BR /&gt;// Returns the correct BaseMonth / Date - See right side object&lt;/P&gt;
&lt;P&gt;Expression: &lt;BR /&gt;I don't want to give all my attempts! They don't work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.JPG" style="width: 799px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/78922iBF6BAF88A4F3446A/image-size/large?v=v2&amp;amp;px=999" role="button" title="example.JPG" alt="example.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really appreciate any assistance with this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 09:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1927865#M76422</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-05-09T09:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Month Start in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1927973#M76425</link>
      <description>&lt;P&gt;Do you have a separate fiscal calendar which contained all relevant fiscal period-fields? With it many of the usual calendar-stuff should work like with a normal calendar - some date-functions may need an appropriate offset-value or might be replaced with a lookup to the fiscal calendar which may not only have years/months/weeks in this context else also (cumulative) working-days, a lot of flags for MTD, LMTD and so on ...&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Fiscal-Year/ba-p/1472103" target="_blank"&gt;Fiscal Year - Qlik Community - 1472103&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/How-to-use-Master-Calendar-and-Date-Values/ta-p/1495741" target="_blank"&gt;How to use - Master-Calendar and Date-Values - Qlik Community - 1495741&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 12:39:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1927973#M76425</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-05-09T12:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Month Start in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928012#M76427</link>
      <description>&lt;P&gt;Thanks for the suggestions:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use a combination of those already - This 1st script is my standard calendar I use where months normally start on the 1st of the month. Works very well for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[$(_calendar)]:&lt;BR /&gt;LOAD&lt;BR /&gt;[$(_field)]&lt;BR /&gt;,YearName([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearName]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1) as [$(_prefix)Year]&lt;BR /&gt;,Month([$(_field)]) as [$(_prefix)Month]&lt;BR /&gt;,date(monthstart([$(_field)])) as [$(_prefix)MonthStart]&lt;BR /&gt;,date(monthend([$(_field)])) as [$(_prefix)MonthEnd]&lt;BR /&gt;,YearStart([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearStart]&lt;BR /&gt;,YearEnd([$(_field)],0,$(FirstMonthOfYear)) as [$(_prefix)YearEnd]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp;'Q' &amp;amp; Ceil(Month(addmonths(addyears([$(_field)],1),-2)) / 3) as [$(_prefix)YearQuarter]&lt;BR /&gt;,(Year(YearStart([$(_field)],0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp; Num(Mod(Month([$(_field)]) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)YearPeriod]&lt;BR /&gt;,inmonthtodate ([$(_field)], Today(), 0, $(FirstMonthOfYear) ) as [$(_prefix)inMTD]&lt;BR /&gt;,inmonthtodate ([$(_field)], Today(), -1, $(FirstMonthOfYear) ) as [$(_prefix)inPMTD]&lt;BR /&gt;,inyeartodate ([$(_field)], Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inYTD]&lt;BR /&gt;,inyeartodate ([$(_field)], Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPYTD]&lt;BR /&gt;,inquartertodate ([$(_field)], Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inQTD]&lt;BR /&gt;,Num(Mod(Month([$(_field)]) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)Period]&lt;BR /&gt;,'Q' &amp;amp; CEIL(MONTH(addmonths(addyears([$(_field)],1),-2)) / 3) as [$(_prefix)Quarter]&lt;BR /&gt;,Div([$(_field)]-YearStart([$(_field)],0,$(FirstMonthOfYear)),7)+1 as [$(_prefix)Week]&lt;BR /&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;BR /&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;BR /&gt;,MonthName([$(_field)]) as [$(_prefix)MonthYear]&lt;BR /&gt;,Year([$(_field)])*12 + Month([$(_field)]) as [$(_prefix)BaseMonth]&lt;BR /&gt;;&lt;BR /&gt;// Generate range of dates between min and max.&lt;BR /&gt;LOAD&lt;BR /&gt;date(DateMin + IterNo()) as [$(_field)]&lt;BR /&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax &lt;BR /&gt;;&lt;BR /&gt;// Find min and max of date field values.&lt;BR /&gt;LOAD&lt;BR /&gt;min(datefield)-1 as DateMin&lt;BR /&gt;,max(datefield) as DateMax&lt;BR /&gt;;&lt;BR /&gt;// Load date field values.&lt;BR /&gt;LOAD &lt;BR /&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;BR /&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;
&lt;P&gt;I am also ok with this results of the below calendar. The fundemental issue I am having is in the expression where I need to show the MTD values of the last 12 Fisc months. The expression shared at first is works when the month starts on the first. I cannot get it to work however when the fisc month starts on the 26th.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[$(_calendar)]:&lt;BR /&gt;LOAD&lt;BR /&gt;//Fiscal Calendar based on mid month start&lt;BR /&gt;*&lt;BR /&gt;,YearName(FiscalDate,0,$(FirstMonthOfYear)) as [$(_prefix)YearName]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1) as [$(_prefix)Year]&lt;BR /&gt;,Month(monthstart(FiscalDate-$(LastDayofFiscYear),1)) as [$(_prefix)Month]&lt;/P&gt;
&lt;P&gt;,if(month(FiscalDate) &amp;gt; 2,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))), Num(Month(FiscalDate)-1),$(LastDayofFiscYear)+1)&lt;BR /&gt;, if(Month(FiscalDate)&amp;gt;1, MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1), Num(Month(FiscalDate)-1 ),$(LastDayofFiscYear)+1)&lt;BR /&gt;, MakeDate((Year(YearStart(FiscalDate,0, $(FirstMonthOfYear)))), 12, $(LastDayofFiscYear)+1))) as [$(_prefix)MonthStart]&lt;BR /&gt;&lt;BR /&gt;,if(month(FiscalDate) &amp;gt; 2, MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))), Num(Month(FiscalDate)),$(LastDayofFiscYear))&lt;BR /&gt;,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1), Num(Month(FiscalDate)),$(LastDayofFiscYear))) as [$(_prefix)MonthEnd]&lt;BR /&gt;,MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)+1) as [$(_prefix)YearStart]&lt;BR /&gt;,MakeDate((Year(YearEnd(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)) as [$(_prefix)YearEnd]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp;'Q' &amp;amp; Ceil(Month(addmonths(addyears(FiscalDate,1),-2)) / 3) as [$(_prefix)YearQuarter] &lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))+1)&amp;amp;'-'&amp;amp; Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)YearPeriod] &lt;BR /&gt;,inmonthtodate(FiscalDate, Today(), 0, $(FirstMonthOfYear) ) as [$(_prefix)inMTD]&lt;BR /&gt;,inmonthtodate(FiscalDate, Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPMTD] &lt;BR /&gt;,inyeartodate(FiscalDate, Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inYTD]&lt;BR /&gt;,inyeartodate(FiscalDate, Today(), -1, $(FirstMonthOfYear)) as [$(_prefix)inPYTD]&lt;BR /&gt;,inquartertodate(FiscalDate, Today(), 0, $(FirstMonthOfYear)) as [$(_prefix)inQTD]&lt;BR /&gt;,Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)Period]&lt;BR /&gt;,'Q' &amp;amp; CEIL(MONTH(addmonths(addyears(FiscalDate,1),-2)) / 3) as [$(_prefix)Quarter]&lt;BR /&gt;,Div([$(_field)]-MakeDate((Year(YearStart(FiscalDate,0,$(FirstMonthOfYear)))),02,$(LastDayofFiscYear)+1),7)+1 as [$(_prefix)Week]&lt;BR /&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;BR /&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;BR /&gt;,MonthName([$(_field)]) as [$(_prefix)MonthYear]&lt;BR /&gt;,(Year(YearStart(FiscalDate,0,$(FirstMonthOfYear))) )*12 + Num(Mod(Month(FiscalDate) - $(FirstMonthOfYear), 12)+1,'00') as [$(_prefix)_BaseMonth]&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;// Use FiscalDate in Fiscal Calendar ONLY - Can drop after loading calendar&lt;BR /&gt;Date(monthstart([$(_field)]-$(LastDayofFiscYear),1)) as FiscalDate,&lt;BR /&gt;[$(_field)]&lt;BR /&gt;;&lt;BR /&gt;// Generate range of dates between min and max.&lt;BR /&gt;LOAD&lt;BR /&gt;date(DateMin + IterNo()) as [$(_field)]&lt;BR /&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax &lt;BR /&gt;;&lt;BR /&gt;// Find min and max of date field values.&lt;BR /&gt;LOAD&lt;BR /&gt;min(datefield)-1 as DateMin&lt;BR /&gt;,max(datefield) as DateMax&lt;BR /&gt;;&lt;BR /&gt;// Load date field values.&lt;BR /&gt;LOAD &lt;BR /&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;BR /&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;
&lt;P&gt;Thank you for actually making the suggestion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 13:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928012#M76427</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-05-09T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Month Start in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928110#M76431</link>
      <description>&lt;P&gt;I'm not sure if:&lt;/P&gt;
&lt;P&gt;...&lt;BR /&gt;&lt;SPAN&gt;Date(monthstart([$(_field)]-$(LastDayofFiscYear),1)) as FiscalDate,&lt;BR /&gt;&lt;/SPAN&gt;...&lt;/P&gt;
&lt;P&gt;and then applying normal date-functions on it is expedient because it means the is no real dates anymore else just monthly values - forced from the monthstart() - and then on top of it the flags and period-information are created with normal date-functions.&lt;/P&gt;
&lt;P&gt;I must admit I never used a financial calendar in productive else just playing with various calendar-types some years ago to learn how they are working but I would tend to replicate a normal calendar structure. Means the first day in it is the 01/01/YYYY (independent from the offset-value between the calendars) and all fiscal month/weeks and flags/consecutive information relate to it. Further I would include the offset-value itself and all needed "translation" information - if beside the fiscal month the offset-month should be displayed or the years are shown with 2021/2022 or any similar stuff.&lt;/P&gt;
&lt;P&gt;Like above hinted it will be important for many information that the offset-value is properly used within the date-functions respectively that these values are created without such functions - with interrecord-functions and/or mappings or similar functions.&lt;/P&gt;
&lt;P&gt;The aim in the end should be not to query date-functions against today() or selected values within the set analysis else using the created flags like:&lt;/P&gt;
&lt;P&gt;sum({&amp;lt; fiscalYTD = {1}&amp;gt;} value)&lt;/P&gt;
&lt;P&gt;Further helpful may be to implement also a&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578" target="_blank"&gt;Canonical Date - Qlik Community - 1463578&lt;/A&gt;&amp;nbsp;to connect the calendars on another way as the dates-offset-key and/or to apply&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130" target="_blank"&gt;The As-Of Table - Qlik Community - 1466130&lt;/A&gt;&amp;nbsp;to combine the various flag-information.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 15:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928110#M76431</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-05-09T15:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Month Start in Expression</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928294#M76440</link>
      <description>&lt;P&gt;It is very rarely I come across someone using this calendar. When I do, and there is this type of comparison needed, I make it clear, in this object, the (mtd) calculation is based on a Calendar month. Although there are manufacturing targets, this object is nice to show how to are doing against the same month last year, mtd, as well as the months in between. It seems for now I will follow the same rules.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, this is the object I am referring to.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.JPG" style="width: 544px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/79006iD696BF8B5CCFC3DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="example.JPG" alt="example.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the pointers,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 05:36:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Month-Start-in-Expression/m-p/1928294#M76440</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2022-05-10T05:36:49Z</dc:date>
    </item>
  </channel>
</rss>

