My blog has moved to jimdehner.com
Thank you for all the support over the past 2 years - I recently updated my blog to make it easier to read, improve the rendering of images and tie back to video presentations that are associated with the content - Check it out at Jim's new blog -
Many businesses use a fiscal calendar for accounting and reporting . Their fiscal year can start on the first day of any month and may not align with the start of a calendar quarter. Tableau makes it easy to adjust for the fiscal year start.
Open the date field and set the Default Property - Fiscal Year Start to the proper Month
This example came from a recent TCish BrainDate- The user has an August fiscal year start and wanted the to be able to select any calendar date and display the current and the prior YTD and QTD sales
(Note: in the US retail sector February and August fiscal year starts are not uncommon - Inventory taxes are often evaluated on inventory levels at the end of January so retailers set the FY start in February or 6 months later - manufacturers who sell into the segment frequently want to be able to see reports or analyses in the retailer Fiscal Year)
Conceptually, the approach is simply determining the fiscal year start date based on a parameter and the Current Date (a calendar date) set by another parameter - used as the end date for YTD and QTD analysis.
Note: The formulas to determine the quarterly adjustment between the fiscal quarters and the calendar month were difficult and took some trial and error - for that reason I included them in the text so you could copy and paste them - the other calculations deciding which calendar dates are between the start and end dates of the fiscal period.
Start by creating a parameter to select a start month - The values are 1-12 and the display is the Month to make it easy on the user
another parameter is simply a date parameter
The FY start date is just based on the Start date parameter converted to a real date
Dateadd('year',0,[Convert Start date to Real date])
But finding the month of the quarter start date will take a series of calculations
The basis to determine which Calendar Year the contains the Fiscal Quarter start - if the value is positive the Current Date and the FQ start are in the same calendar year - if the value is negative the FQ starts in the prior calendar year
month([Current Date]) - Min(Int([FY Start Month Parameter]))
The adjustment that will be used in Dateadd function is actually
If [Number months Current date and FY Start]>= 0
then [Number months Current date and FY Start]
ELSE 12+[Number months Current date and FY Start] end
The FQ for the Current date is
For the prior year fiscal year start the formula simply is:
Dateadd('year',-1,[Start Date - Real])
The prior quarter is
The formulas of the YTD QTD prior YTD and Prior QTD are straight forward LODs that total the sales between the period start and end dates
YTD sales for the Current Fiscal year
Prior fiscal year YTD sales
Prior year fiscal quarter sales
In table form the user can select the starting dates and the table updates to return the year and quarter to date values
A look at the monthly detail makes it easier to see what the formula do
The current YTD include the months of August - December 5th, QTD is November - December 5th
The prior YTD is in FY 17 August 2017 - December 5, 2017 and the prior QTD is in FY 18 August 2018 - September5, 2018
Hope it makes sense to you
The workbook which contains all the complex formulas can be downloaded at Link to Tableau Public
Enjoy
Jim
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.