Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A calendar is very useful when you want to link your data to different time periods, e.g. when you want to display your KPIs over different years or months. Often you only have one date and you just want to use a standard calendar. For this case, there are plenty of resources on this community. You can find a good overview on How to use - Master-Calendar and Date-Values..
If you have several date fields, you should most likely have several calendars defined in your script. See
Why You sometimes should Load a Master Table several times
If you want to use a non standard calendar, like a fiscal calendar or a 4-4-5 calendar, the challenge becomes more difficult. See e.g. Fiscal Yearor Recipe for a 4-4-5 Calendar.
The script posted here will help you create a more complicated calendar. It has parametrized examples for the following calendars:
There are several parameters that you can use to configure your calendar: The first month of the year, the first day of the week and the first week of the week-based year.
The script is commented, so hopefully you can read it and understand it. You can paste it straight into an empty app and run it to evaluate how it works. If you want to use parts of it inside one of your own apps, you may need to rename some fields.
The script should work in both Qlik Sense and QlikView.
Good Luck!
HIC
Hi Henric,
Hope you can help me on the Below.
My source has sales & budget data so it has order date, Transaction date and budget date. Please help me with some logic for the below scenario .
1. How to find 'Total Number of weeks in the current month'. Week starts from Monday.If the week has started already it should be considered as same week irrespective of the new month start. If the month starts on middle of the week that should consider as last week of the previous month.I am able to achieve but not as desired.
(Answer is: Jan 5 weeks,Feb 4 weeks,Mar 4 weeks,Apr 5 weeks, May 4 weeks,June 4 weeks, July 5 weeks,Aug 4 weeks,Sep 4 weeks,Oct 5 weeks,Nov 4 weeks,Dec 5 weeks,)
Result what i am getting is : Feb 5 weeks, March 6 weeks but it should be 1 week less because Feb 1 false under last week of January and march 1 falls under last week of Feb.
2. Max(OrderDate) falls in which week of the current month.
Ex: if OrderDate 3/1/2019 this is falls in 4th week of Feb.
I have attached the QVW. in the below link.
Total Number of-weeks in the current month
Thanks!
Pooja
Hi to all!
Amazing script, but as a newbie in qlik world I would like some assistance about setting the dates.
I used the 445 week part, when I selected the year 2022 I got first date 28/08/2022 and last 26/08/2023.
What changes I should do? I want to use the 445 rule but year starts at Jan and finishes at Dec.
(if it has been answered already I am sorry but I didn't understand it obviously....)
Thank you for your time