VizWiz

Launch, grow, and unlock your career in data
Showing posts with label weekends. Show all posts

September 12, 2023

How to Calculate Weekday-Only Sales in Tableau

No comments

Have you ever wondered how to compare sales performance between two sets of weekdays? 

In this video, I'll show you how to calculate and compare sales for the last 10 weekdays against the prior 10 weekdays—all while excluding weekends. 

What You Will Learn:

  1. Setting up your data source for comparison
  2. Creating calculated fields for two sets of weekdays
  3. Configuring table calculations to get only the days you need
  4. Filtering out weekends from both data sets
  5. Implementing advanced date functions for comparison
  6. Visualizing and comparing sales for both sets of weekdays

Background Context:

Tableau enables you to conduct intricate data analyses, but comparing specific sets of weekdays can be tricky. This tutorial simplifies that process, focusing on comparing the last 10 weekdays' sales with the 10 weekdays preceding them.

Assumptions:

  1. You have a foundational knowledge of Tableau.
  2. Your sales data contains date information.
  3. You've previously worked with calculated fields in Tableau.

Related Videos:

  1. Tableau for Beginners: Link
  2. Everything you need to know about table calcs: Link

Resources:

  1. Workbook & data: Link


January 31, 2023

How to Calculate Day over Day Change Excluding 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

  1. Latest Day
    {MAX([Order Date])}

  2. Weekday for Latest Day
    DATEPART('weekday',[1. Latest Day])

  3. Sales for Latest Day
    INT([Order Date]=[1. Latest Day])*[Sales]

  4. Previous Day
    IF [2. Weekday for Latest Day]=2
    THEN [1. Latest Day]-3
    ELSE [1. Latest Day]-1
    END

  5. Sales for Previous Day
    INT([Order Date]=[4. Previous Day])*[Sales]

  6. DoD Change
    SUM([3. Sales for Latest Day])-SUM([5. Sales for Previous Day])

  7. DoD Change %
    [6. DoD Change]/SUM([5. Sales for Previous Day])

  8. Positive Change
    [7. DoD Change %]>0