January 31, 2023
How to Calculate Day over Day Change Excluding Weekends
% difference
,
boolean
,
calculated field
,
change
,
color
,
comparison
,
daily change
,
datepart
,
dates
,
day over day
,
integer
,
level of detail
,
LOD
,
percent change
,
tableau
,
tip
,
variance
,
weekends
No comments
In a previous tip, I showed you how to calculate day over day change and build 3 KPI cards.
However, this does not cover the case when you need to ignore weekends. In this #Tableau tip, I show you how to calculate daily change excluding the weekends.
You can copy/paste the calculations from below the video. Enjoy and good luck!
Calculations
- Latest Day
{MAX([Order Date])} - Weekday for Latest Day
DATEPART('weekday',[1. Latest Day]) - Sales for Latest Day
INT([Order Date]=[1. Latest Day])*[Sales] - Previous Day
IF [2. Weekday for Latest Day]=2
THEN [1. Latest Day]-3
ELSE [1. Latest Day]-1
END - Sales for Previous Day
INT([Order Date]=[4. Previous Day])*[Sales] - DoD Change
SUM([3. Sales for Latest Day])-SUM([5. Sales for Previous Day]) - DoD Change %
[6. DoD Change]/SUM([5. Sales for Previous Day]) - Positive Change
[7. DoD Change %]>0
Subscribe to:
Post Comments
(
Atom
)
No comments
Post a Comment