Week-based calendars are used in many companies as their fiscal calendars. The total weeks in a fiscal year is 52 weeks, that is, 364 days. Each quarter has 13 weeks. There are 3 varieties of 13 weeks: 5-4-4, 4-5-4 and 4-4-5 weeks per quarter. In leap years, there are 53 weeks or 371 days. IRS has created special code for the 52-53-week fiscal years.

Each company's week-based fiscal calendar will differ in 4 ways:

- define the 13-week quarter as 5-4-4, 4-5-4 or 4-4-5
- define its own start week 
- define its own way of placing the leap week
- define the first day of week as Sunday, Monday etc.

Please refer to each company's official fiscal calendar for the exact design. This post is just a reference for the conversion of a common date to fiscal dates under given rules.

Apple's Fiscal Calendar is widely disseminated on the web. Here we try to clarify some of the misunderstandings and provide calculation assistance in Tableau for analyzing time series based on the 5-4-4 format. We will use Apple's fiscal calendar as an example below.

Common Fiscal Year

In a common year, it's a 52-week year which has 52x7 = 364 days.

A year has 4 quarters and each quarter has 3 fiscal periods/months. 

Each quarter has 13 weeks.

At Apple, the first period of a quarter has 5 weeks and the other two have 4 weeks each. It's thus called a 5-4-4 calendar.

First Week of a Fiscal Year

For a week-based calendar, it is very important to understand the definition of its first week. Each company may have a different definition of the first week.

For Apple's fiscal calendar, its first week is the one that always includes October 1st. This week is the first one of the next fiscal year. For example, the week that includes 10/1/2022 is the first week of fiscal year 2023.

First Day of a Week

In Apple's fiscal calendar it's always a Sunday. There may be other conventions where we need to change the following calculations.

Leap Rule

Every 6 years or so, there will be a leap fiscal year. 

A leap fiscal year will have 53 weeks, one more week than the common fiscal year. 

The cause of the leap fiscal year is as follows:

- A common fiscal year has 364 days while a common calendar year has 365 days. It is 1 day less than the calendar year. It seems that every 7 years, we need to add a week to the common fiscal year to realign the starting dates of fiscal years. But the 7-year frequency is broken by the leap calendar years because a calendar year doesn't always have 365 days. This makes it a lot less predictable when guessing which year is a leap year.

- A calendar year has its own leap year which has 366 days. This happens on every 4 years on the years divisible by 4 and excluding the years that can be divided by 100 but can't be divided by 400.   

The leap years in the next 100 years and the gaps in between.

Leap Week

In a leap fiscal year, there will be an extra week or a leap week. Where to place it depends on the company. In Apple's fiscal calendar, it's added in the third fiscal month which becomes a 5-week month during a leap fiscal year. That is, we insert the leap week after the 13th week of the fiscal year. Or the 14th week of a leap fiscal year is the leap week.

Placement of the Leap Week

We have an extra week in a leap fiscal year. It is appended to the end of the first fiscal quarter or the 3rd fiscal month/period. Thus, the first fiscal quarter, instead of 5-4-4 quarter and having 13 weeks, it becomes 5-4-5 quarter and having 14 weeks.

How to Determine if a Fiscal Year is a Leap Year?

This is easy. Just find out if October 1st in two consecutive years has a gap of 53 or 52 weeks. If 53 weeks, it is a leap year for sure.  So, use this logical formula:

The First Day of a Fiscal Year

The Sunday of the first week is the first day of the fiscal year.

In Tableau formula, we can easily derive the first day of a fiscal year. For example for the fiscal year 2023, the first day is:

DATETRUNC('week', MAKEDATE(FiscYear-1,10,1))

Some says the first day is always the last Sunday of September. This is not exact. It's only about 6/7 correct. It's the Sunday within Sept 25th - Oct 1st. 

The Last Day of a Fiscal Year

It's actually the last Saturday in September. For any FiscYear, the last day is the first day of the next FiscYear minus one.

DATETRUNC('week', MAKEDATE(FiscYear,10,1))-1

Convert a Date to Fiscal Year/Quarter/Month/Week?

Here are the Tableau formula we can use to convert a regular date to its corresponding fiscal date. Note that they are dependent on the ones above them.

- What fiscal year is it in? We got FiscYear which is dependent on Order Date alone.

- What fiscal week is it in? We got FiscWeek which is dependent on Order Date and FiscYear.

- What fiscal month (period) is it in? We got FiscMonth which is dependent on FiscWeek and Leap Year T|F. (Credit Steve Fenn

- What fiscal quarter is it in? We got FiscQuarter which is dependent on FiscMonth.

Conclusion

Note that each company may have its own way of defining its week-based fiscal calendar. Hope that this post can give you some ideas for deriving your own specific formula.

Feel free to download this workbook and copy over the formula if you wish. Contact @aleksoft if questions. 

0

Add a comment

(Refresh the page if you want to view the gif image multiple times. Or go to Tableau Public and click the button at the top-right corner.)

Jake and I collaborated on a dashboard. He told me that he learnt a way to create an in-place help page in Tableau. He first saw it at a conference somewhere and couldn't recall who the speaker was. So I am blogging here about it but the credit goes to somebody else. If anyone knows who the original creator is, leave a comment below.

The key idea is to float a semi transparent worksheet on top of the dashboard, where a help text box is strategically placed on top of each chart. This way, we can explain how to view each chart and what data points are important, etc. This worksheet is collapsible by a show/hide button.

(Addendum: Jonathan Drummey has a much better Tableau-only solution that I missed from his presentation. I only caught later part of the presentation. You might ask him about it if you know him.)

In a recent presentation, Tableau visionary HOF Jonathan Drummey talked about a solution for a variable row heights in a text table. The question apparently came from a perfectionist tableau designer. Tableau is not really made for text processing.

[Forward: I asked ChatGPT o1-mini who then wrote this. Hope it helps. All the credit and the blame go to ChatGPT.

I went over the plan and it looked decent. Whether it can be done in 30 days or not, it depends on the person and the time he spends on it. By the way, ChatGPT can be a really good study buddy. Ask it questions whenever you have any.]

This comprehensive 30-day plan is designed to take you from a Tableau beginner to an advanced user.

Mundane charts are those basic ones that all data visualization beginners can create, possibly with Show Me in Tableau. They are the boring ones at times because many people tend to create fancier ones just to show off. 

I actually like the mundane ones a lot because they are not only easy to create but also easy to be read by the stakeholders.

Pareto chart is a very powerful tool, providing great insights into the data set and into the business at stake.

A while ago, Sharon came to me asking a question regarding Pareto Chart Multiples. That is, per each category, there is a Pareto chart. And we need to create Pareto charts for all the categories. This chart allows us to quickly view the few most important factors that matter to the majority of output in each category. 

Vilfredo Pareto (1848-1923) is the father of the 80/20 rule: 80% of output are produced by 20% of input. It works magically well through all the years.

[Update: The product manager Wilson Po alerted me that the Viz Extension is still a work in progress. It will not be part of the incoming version 2024.1. Instead, it will be released later in 2024. Just be patient]

Tableau 2024.1 is coming. I got a chance to test drive it. As I wrote a bunch of posts on Sankey chart tutorials in the past, I am most excited by the new Sankey chart type. Here I would like to share what I learnt. This is a quick preview. Your comments are welcome.

Buzzfeed recently asked Midjourney to draw images of people in 50 US states.  So the AI drawing tool created 50 images of couples that represent its perception of the people in each state.

I just put the images into a tiled map in Tableau. Each image is added as a background in each tile.

And also I added Viz-in-tooltips to enlarge an image to look at more details.

Feel free to download the workbook and explore it.
1

The folks at Business Expert had a brilliant idea. They asked AI's perception on UK banks as a dog. I am inspired to do the same on US banks.

ChatGPT is asked to confess its perceptions on top US banks as a dog. Then Midjourney is tasked to generate the images. Check out what dog is matched to your favorite bank.

All are put together into a single-sheet Tableau dashboard. Feel free to check it out.

Through my previous post on the new Sankey chart type, I got in touch with Wilson, the product manager leading the development of this new chart type. I made some comments on creating multi-level Sankey via cascading of single Sankey's. He told me it can be done already by dropping more dimensions into the Level card.

As an enthusiastic user of Sankey charts, I am excited to learn that a Sankey chart type is being piloted in Tableau Public (Web Edit only). I wrote about Sankey chart design in multiple posts. Sankey chart may appear in different forms depending on applications. 

I played a little with it just to evaluate it. Here are my initial findings and comments.

1. The basic Sankey

I can quickly create a Sankey with 2 dimensions and 1 measure.
Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.