1.Introduction

Imagine you are a data analyst tasked by the store manager to monitor inventory levels. This would mean calculating the percentage of time inventory levels are either below the minimum level (under-stocked)which is a trigger to order more stock, and the percentage of time inventory levels is above the maximum level (over-stocked) which should be avoided as this can result in increased storage cost and reduced profits.

 

2. The solution

For this example, we can demonstrate how this can be done in tableau. The test data contains the date, value which is the current stock level, min which is the minimum stock level and max the maximum stock level as set by the company.

Next we create a calculated field to determine the percentage of time inventory levels are either over-stocked, under-stocked or at optimal stock levels.

Name the calculated field as above min max? and type the following:

IF [Value] > [Max] then ‘Over-Stock’
ELSEIF [Value] < [Min] then ‘Under-Stock’
else ‘Optimal stock level’
END

Drag the calculated field to columns, and also to the rows. Set the rows to be continuous and count the number of events to get the following chart.

Now we can create a simple dashboard to show the trend in the inventory level over time and also the percentage of time stock levels was either over-stocked, under-stocked or at optimal stock levels.

 

The Data School
Author: The Data School