<?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 find correct week number for multiple date fields using fiscal calendar in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/find-correct-week-number-for-multiple-date-fields-using-fiscal/m-p/2005880#M83233</link>
    <description>I have many data sets in my dashboard

1st data table has field called - Date
2nd data table has field called - HC_Date
3rd data table has field called - CHG_Date

Below calendar script gives correct week number for 1st Dataset where field = "Date" but not for other 2 date fields (HC_Date &amp;amp; CHG_Date)

Note: I dont want to make common field like&amp;nbsp;&amp;nbsp;HC_Date as Date&amp;nbsp;&amp;nbsp;

LET vFM = 9; // first month of the fiscal year
LET varFiscal = Num(MakeDate(2021,9,1))-Num(MakeDate(2021,1,1)); //day difference from Normal Year and Fiscal Year
[Fisc]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
 &amp;nbsp;Dual('FY'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [Year] Tagged ('$axis', '$year'),
 &amp;nbsp;Dual('Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,1-vFM)))/3)),Num(Ceil(NUM(Month(AddMonths($1,1-vFM)))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
 &amp;nbsp;Dual('FY'&amp;amp;(Right(YearStart($1,0,vFM),2)+1)&amp;amp;'-Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,1-vFM)))/3)),QuarterStart($1,0,vFM)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
 &amp;nbsp;Dual('Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,0,1-vFM)))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
 &amp;nbsp;Dual(Month($1), Month($1)) AS [Month] Tagged ('$month', '$cyclic'),
 &amp;nbsp;Dual(Month($1)&amp;amp;'-'&amp;amp;(Right(Date(Floor($1)),2)), MonthStart($1,vFM)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
//(Right(YearStart($1,0,vFM),2)+1),&amp;nbsp;&amp;nbsp;Dual(Month($1), monthstart($1,1-vFM)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
 // Dual('W'&amp;amp;Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dual('W'&amp;amp;Num(Week(Date-$(varFiscal)),00), Num(Week(Date-$(varFiscal)),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&amp;nbsp;&amp;nbsp;//&amp;nbsp;&amp;nbsp;Week (Date-$(varFiscal)) AS [FiscalWeek],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
 &amp;nbsp;Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified');
// create derived fields for fiscal year
DERIVE FIELDS FROM FIELDS [Date], [HC_Date], [CHG_Date], [Candidate Start Date], [Hire Date] USING [Fisc] ;

Please guide</description>
    <pubDate>Thu, 17 Nov 2022 12:42:20 GMT</pubDate>
    <dc:creator>deeavhad</dc:creator>
    <dc:date>2022-11-17T12:42:20Z</dc:date>
    <item>
      <title>find correct week number for multiple date fields using fiscal calendar</title>
      <link>https://community.qlik.com/t5/App-Development/find-correct-week-number-for-multiple-date-fields-using-fiscal/m-p/2005880#M83233</link>
      <description>I have many data sets in my dashboard

1st data table has field called - Date
2nd data table has field called - HC_Date
3rd data table has field called - CHG_Date

Below calendar script gives correct week number for 1st Dataset where field = "Date" but not for other 2 date fields (HC_Date &amp;amp; CHG_Date)

Note: I dont want to make common field like&amp;nbsp;&amp;nbsp;HC_Date as Date&amp;nbsp;&amp;nbsp;

LET vFM = 9; // first month of the fiscal year
LET varFiscal = Num(MakeDate(2021,9,1))-Num(MakeDate(2021,1,1)); //day difference from Normal Year and Fiscal Year
[Fisc]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
 &amp;nbsp;Dual('FY'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [Year] Tagged ('$axis', '$year'),
 &amp;nbsp;Dual('Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,1-vFM)))/3)),Num(Ceil(NUM(Month(AddMonths($1,1-vFM)))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
 &amp;nbsp;Dual('FY'&amp;amp;(Right(YearStart($1,0,vFM),2)+1)&amp;amp;'-Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,1-vFM)))/3)),QuarterStart($1,0,vFM)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
 &amp;nbsp;Dual('Q'&amp;amp;Num(Ceil(Num(Month(AddMonths($1,0,1-vFM)))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
 &amp;nbsp;Dual(Month($1), Month($1)) AS [Month] Tagged ('$month', '$cyclic'),
 &amp;nbsp;Dual(Month($1)&amp;amp;'-'&amp;amp;(Right(Date(Floor($1)),2)), MonthStart($1,vFM)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
//(Right(YearStart($1,0,vFM),2)+1),&amp;nbsp;&amp;nbsp;Dual(Month($1), monthstart($1,1-vFM)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
 // Dual('W'&amp;amp;Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dual('W'&amp;amp;Num(Week(Date-$(varFiscal)),00), Num(Week(Date-$(varFiscal)),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&amp;nbsp;&amp;nbsp;//&amp;nbsp;&amp;nbsp;Week (Date-$(varFiscal)) AS [FiscalWeek],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
 &amp;nbsp;Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified');
// create derived fields for fiscal year
DERIVE FIELDS FROM FIELDS [Date], [HC_Date], [CHG_Date], [Candidate Start Date], [Hire Date] USING [Fisc] ;

Please guide</description>
      <pubDate>Thu, 17 Nov 2022 12:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/find-correct-week-number-for-multiple-date-fields-using-fiscal/m-p/2005880#M83233</guid>
      <dc:creator>deeavhad</dc:creator>
      <dc:date>2022-11-17T12:42:20Z</dc:date>
    </item>
  </channel>
</rss>

