10 Replies Latest reply on Feb 20, 2017 1:45 AM by Hima vardhan Reddy Pavuluri

# I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

My problem is very simple, I want to  comparing sum(Sales) on behalf of checked and unchecked of sub-category. you can find below attachment for better understanding.

• ###### 1. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

HI

you should use calculated field somewhat like

Total sale - sale as it will decrease the sale of selected sub category from the total sale which obviously return unselected sale

• ###### 2. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hi , Check the below solution :

Drag Region into Columns shelf and Category into filters shelf and sales into Rows shelf .

Now you got the view for sum(sales) by Region for selecting Category in quick filter.

Now Create a calculation like below for Non Selected Category sales by Region :

Drag this calculation into Rows shelf and make it Dual axis.

Check the below screenshot :

1 of 1 people found this helpful
• ###### 3. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hi Nipun,

How can i use this logic in tableau calculation, Please suggest.

• ###### 4. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hey Aman,

Please check my solution above. It will give you the right calculation and output as you are expecting .

• ###### 5. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hi Hima,

thanks for reply,  i tried with your calculation but its not giving correct O/P.

1.line graph is for checked sub-category

2. Line graph shows unchecked sub-category.

that is my requirement. i hope you understand.

• ###### 6. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

That is what it showing in the pic which i posted above right ?

One line is showing the sales value for checked categories and other line is showing for unchecked categories ?

• ###### 7. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hi

PFA

• ###### 8. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Hi Hima,

here is difference which i got for other sales while validating...

• ###### 9. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

yep ! that is because you have one more filed Order Date in your view , so you can just modify the calculation to include Order Date as well !

• ###### 10. Re: I am comparing Sum(Sales) for selected Sub Category vs Other Sub Category

Check this :

1 of 1 people found this helpful