Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qliknerd
Contributor III
Contributor III

Bug in Calendar Script [FIXED]

Hi

A while ago I suggested adding YTD and PYTD flags to the 7.CalendarGen.qvs script:

if(YearToDate([$(vL.DateFieldLinkName)], 0, 4, $(vL.CalendarGenToday)),1,0) AS [$(vL.CalendarTableName) Fiscal YTD Flag],
if(YearToDate([$(vL.DateFieldLinkName)], -1, 4, $(vL.CalendarGenToday)),1,0) AS [$(vL.CalendarTableName) Fiscal PYTD Flag]

This was added to the script and now appears as:

if(YearToDate([$(vL.QDF.DateFieldLinkName_new)], 0, $(vL.QDF.MonthsLeftFiscalDates), $(vL.QDF.CalendarGenToday)),1,0) AS [$(vL.QDF.CalendarTableName) Fiscal YTD Flag],
if(YearToDate([$(vL.QDF.DateFieldLinkName_new)], -1, $(vL.QDF.MonthsLeftFiscalDates), $(vL.QDF.CalendarGenToday)),1,0) AS [$(vL.QDF.CalendarTableName) Fiscal PYTD Flag]

However these flags are only returning a "0"

I'm based in the UK, so my month offset is 4 as per the first example. The $(vL.QDF.MonthsLeftFiscalDates) variable I use is normally -3 so could be part of the problem.

Grateful if someone could investigate please.

Thanks

Ian

13 Replies
Anonymous
Not applicable

Hi Ian,

I had a quick test and it looks great. The only nuance I see is if you specifically wanted a Fiscal Calendar created that ran from Jan - Dec. If you put in 12 there is no issue. However if you put in in -12 then the fiscal year is the previous year. However this scenario does not make sense as the Fiscal Year is the annual year.

Damian

Magnus_Berg
Employee
Employee

Hi Ian, the fix is approved and committed. Have also updated the deploy package:Qlik Deployment Framework Deploy Tool

Best regards

Magnus

qliknerd
Contributor III
Contributor III
Author

Magnus, great news thank you. I'll update out Development Env today and do some testing.

Damian, thank you too for applying the initial fix and for your promptness.

Have a good day all

Kind Rgds

Ian