2 Replies Latest reply on Jun 30, 2016 4:33 AM by Lotte Kammenga

# Sum up total of all within a group

Hi all,
I'm making a report where I'm comparing the performance of one product in relation to all products within the product group.

I'm specifically looking at how many products are returned and after what time.

My Tableau table looks like this

So you can see that at the point of sale nobody has returned, and the percentage of live sales gets lower as time goes on.

Within the product groups are multiple products, the products have product codes. The table for the product codes looks the same in Tableau as the one above, except it has a product code on the row label.

What I'm interested in is comparing the performance of one product with the overall performance within the group.

I can't provide an example workbook because it contains customer data, but the data looks like this. The number of months the sale has been live is a calculated field.

 ProductCode Product Group Sale Date Cancel Date 123456 Group 1 Jun 2012 Oct 2015 123457 Group 1 Aug 2015 123458 Group 1 Jan 2011 Mar-11 123459 Group 1 Jun 2014 Feb-15 123460 Group 1 Sep 2010 123461 Group 1 Sep 2006 123462 Group 2 Jun 2012 123463 Group 2 May 2015 Dec-15 123464 Group 2 Dec 2011 123465 Group 2 Jun 2015 123466 Group 2 Sep 2010 123467 Group 3 Sep 2006 123468 Group 3 Jun 2012 May-15 123469 Group 3 Aug 2015 Aug-15 123470 Group 3 Jan 2011 123471 Group 4 Jun 2014 123472 Group 4 Sep 2010 Apr-14 123473 Group 4 Feb 2007 123474 Group 4 Apr 2011 123475 Group 4 Jun 2013

Ultimately what I want is a graph with one line for the product code, and a line for the product group within the same graph. However, I can't do a dual axis because then the filter on product code would apply to both selections, and it won't give me a total of all products within the product code.

I think the only way to do it is to get both values (total for the product and total for the group) in the same table first. So what I'm trying to do is select a product code, and then I want Tableau to look at what group the product belongs to, and give me a grand total of everything in the group. But I don't know how to do that. Can any of you help me?
Thanks,
Lotte

Hi,