6 Replies Latest reply on Nov 24, 2016 3:55 AM by Nhan Nguyen

# Sum error when connects two table

Hi I have a problem like this:

I have two table: Table 1 and 2:

Table 1:

Table 2:

When I connect 2 tables together, the number of Sales Man in table 1 shows up in table 2 like this: I call this table 3

Then, I want to calc the average value of how much 1 Sale Man can sell product, so my Fomular is: Sum(VND)/sum(SalesMan), but the result is not my expectation. I found that when I sum the total Sales Man, it returns the total sales man of each row in the Table 3. My expectation is the result should be the total sales man of table 1. Can you help me find the solutions? Thank you so much, I'm a newbie here :-).

One more question:

I want to calc the number of SoldSKU / Order, but both of them are in the same column 'DataType'. What kind of fomular can I use in this case? Thank you.

• ###### 1. Re: Sum error when connects two table

Hi.

How are you connecting these tables in tableau?

It seems a granularity problem but i need to see your datasource.

I need to see this:

If you union using a join and you have more than one line(counting key field) on right table, this you multiply your result.

• ###### 2. Re: Sum error when connects two table

Hi, it's here

• ###### 3. Re: Sum error when connects two table

See:

Then, I want to calc the average value of how much 1 Sale Man can sell product, so my Fomular is: Sum(VND)/sum(SalesMan), but the result is not my expectation. I found that when I sum the total Sales Man, it returns the total sales man of each row in the Table 3. My expectation is the result should be the total sales man of table 1. Can you help me find the solutions? Thank you so much, I'm a newbie here :-).

I did here and this is exactly what happens in a calculator:

To Daily KPI Report by DSR_2016-11-01_2016-11-21, i believe you need to fix datasource.

Value joining by area only:

Value joining by all Fields:

This value is qty of records resulting on table. Huge difference.

What version of Tableau do you use?

• ###### 4. Re: Sum error when connects two table

hi,

I'm using Version 9.3. The latest build of 9.3.

About the number of Sales Man as I can see in your image, it shows 133,138 which is exactly what I saw in my case. But this is not true, the total Sales Man at my company is just 726. The value shown in our image is simply just sum of every single row in the Table 3.

• ###### 5. Re: Sum error when connects two table

As i told you before, you are multiplying records.

You can't make a left join.

You need to use a union, but first you need to correct the column names.

Sitecode needs exactly the same name to work.

• ###### 6. Re: Sum error when connects two table

Thank you, you made my day ^^.

Do you have any idea about the question 2?

Thanks again.