2 Replies Latest reply on Jul 25, 2017 5:07 AM by Jim Dehner

How can I create cumulative sales units by week using the calculated field?

• I want to create a single pill which calculates specific sell-through (%) each week over time at a line or category-level.
• My Sell-Through calculation is:

(cumulative sales units from start of season / (cumulative sales units from start of season + current stock))

• My table currently includes:

Product description, category, price, a sales value, stock level & week number on the same line

(please see sample data sheet to see how data is formatted)

• I want to plot sell-through using the calculation above by week, by line or aggregation of category
• As I don’t have cumulative sales by week in the data – I guess I need to calculate this in the in Tableau – this is where I need help.
• I know how to calculate cumulative sales using table calc. (running totals) but can’t figure it out using calculated field
• 1. Re: How can I create cumulative sales units by week using the calculated field?

Hi

Attached is a t10.1 workbook - I will take you through the calculations below

First the cum sales are           sum(zn([Sales Units]))+PREVIOUS_VALUE(0)  - it is a table calculation and is an aggregation

Next the sell through is           zn([cumulative sales units])/(zn([cumulative sales units])+sum(zn([Stock Level])))

You can use them to create this in line chart

Or this as a text chart

Let me know if this helped

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• 2. Re: How can I create cumulative sales units by week using the calculated field?

Thanks Jac