5 Replies Latest reply on Dec 3, 2012 9:28 AM by Jonathan Drummey

# Aggregating Sales Data Day to Week

I have a data set that has daily sales for company A and market sales that is an aggregation of companies A, B, C, D, and E. I am trying to view company A sales as a percent of market sales (companies A, B, C, D, and E) by week. When I create a calculated field by dividing company A sales by the market sales (I am calling this percent of sales) and view this by week Tableau is summing the daily percents (which is useless) instead of summing company A sales then dividing by the market sales and giving the percent of sales for the week. Does anyone know how to get the proper calculation? Thanks in advance!

• ###### 1. Re: Aggregating Sales Data Day to Week

Hi,

Could you post a packaged workbook with some sample data? It's hard to answer your question without knowing what aggregations are being performed, etc.

Jonathan

• ###### 2. Re: Aggregating Sales Data Day to Week

Sorry but I don't feel comfortable posting any data.

I will try to explain the issue with theoretical data, if this is not clear please have somebody contact me.

Company A sales:

Monday \$5

Tuesday \$3

Wednesday \$5

Thursday \$4

Friday \$3

Saturday \$5

Sunday \$2

The whole week \$27

Company A+B+C+D+E sales:

Monday \$10

Tuesday \$12

Wednesday \$17

Thursday \$15

Friday \$12

Saturday \$15

Sunday \$10

The whole week \$91

When the data is rolled up to the week level I would expect to see that Company A has 29.7% of sales (27/91). However what I actually see is 50%+25%+29.4%+26.7%+25%+33.3%+20%+29.7%=209.4% or a sum of daily percent sales for the week long period.

Thanks!

• ###### 3. Re: Aggregating Sales Data Day to Week

Hi Jacob,

Can you provide a spreadsheet with the mocked up data? I'm still not clear on whether Company A, B, C, D, etc. sales each get one row per company/date, or whether the total sales are an additional column, etc. Even better would be a Tableau workbook using that mocked up data and your calculations so far, then we'd be able to help point to exactly where the calcs are returning incorrect results.

Jonathan

• ###### 4. Re: Aggregating Sales Data Day to Week

If someone could contact me directly it would be greatly appreciated.

• ###### 5. Re: Aggregating Sales Data Day to Week

Hi Jacob,

You haven't made your email address available to other forum users, so we can't contact you directly. If you'd prefer to work with Tableau tech support, their email is support@tableausoftware.com, otherwise you can reach me at jonathan (dot) drummey (at) gmail.

Jonathan