Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Customized Fiscal year..

Hi all,

I am new to Qlik. And never implemented Customized fiscal year.

Can some one help with the script for below

Screenshot.jpg

Thanks in advance

4 Replies
marcus_sommer

Have a look on these examples:

Fiscal Year

Fiscal Calendar with Non-Standard Days (Not 1-31)

- Marcus

Not applicable
Author

Thanks for fast response. I will work on this. Looks like it works for me.. Thanks

Not applicable
Author

Hi marcus_sommer

Can you make changes  to the below code.

I have date field called "Orderdate"

Start date: 2016-jan-04

End date: 2017-Jan-01.

  1. LET vStartDate = MakeDate(2015, 1, 1); 
  2. LET vEndDate = MakeDate(2016, 12, 31); 
  3. LET vNumberOfDays = vEndDate - vStartDate + 1
  4.  
  5. FiscalCalendar: 
  6. LOAD 
  7. *, 
  8. Month(FiscalDate) AS Month, 
  9. Year(FiscalDate) AS Year, 
  10. 'Q' & Ceil(Month(FiscalDate)/3) AS Quarter, 
  11. MonthName(FiscalDate) AS MonthYear, 
  12. 'Q' & Ceil(Month(FiscalDate)/3) & '-' & Year(FiscalDate) AS QuarterYear; 
  13. LOAD Date, 
  14. Date(monthstart(Date-25,1)) as FiscalDate, 
  15. Day(Date(Date-25)) AS DayNumberInMonth; 
  16. LOAD 
  17. Date(makedate(2015)+recno()-1) as Date 
  18. AutoGenerate $(vNumberOfDays);

What if my date have before and after this start and end dates..?

Thanks

marcus_sommer

There are several ways possible. One is to include a longer period within the calendar and to delete the excess dates afterwards with a where-clause and another (I think more commenly used) is to create the calendar fom the min to max dates within the fact-table data. Here is an example where the min/max dates from the order-table will be used (filling the variable with a peek-function) to determine the scope of the calendar:

Better Calendar Scripts | Qlikview Cookbook

- Marcus