1 2 Previous Next 15 Replies Latest reply on Nov 4, 2016 9:18 AM by Kashish Chauhan

# Why isn't a simple sum function working?

I'm new to Tableau, so bare with me, but I'm trying to calculate a simple 'Hires - Terms' net number.  And for whatever reason when I enter a calculated field of [Hires]-[Terms] it gives me zero.  What am I missing?

• ###### 1. Re: Why isn't a simple sum function working?

Hi Ryan,

Try sum(hires)-sum(terms)

Thanks and Regards,

Kashish

• ###### 2. Re: Why isn't a simple sum function working?

Awesome, thank you!

Any idea how I can get that number as a line on my area chart?  I want that net number to be on the area chart above.  I don’t see a secondary axis option (maybe because I already have two axis going?

• ###### 3. Re: Why isn't a simple sum function working?

Ryan please attach a packaged workbook or explain with the help of a screenshot. It would make it easier for me to provide you a solution. A packaged workbook can be made by saving your Tableau workbook as .twbx.

• ###### 4. Re: Why isn't a simple sum function working?

I need the bottom line on the area chart to show a net difference.

1 of 1 people found this helpful
• ###### 5. Re: Why isn't a simple sum function working?

Are you asking for a reference line which would show a difference value?

1 of 1 people found this helpful
• ###### 6. Re: Why isn't a simple sum function working?

Yes.  It’d be the net impact (hires-terms).  Can I do that through the analytics tools?

• ###### 7. Re: Why isn't a simple sum function working?

Is this what you want?

The reference lines are showing the difference in sales and profit whereas the bars are showing me the profits.

1 of 1 people found this helpful
• ###### 8. Re: Why isn't a simple sum function working?

Yes, that’d work.  I just need to show the net effect by month.

• ###### 9. Re: Why isn't a simple sum function working?

Just bring the difference calculation to the Detail mark and then on your continuous axis right click and select 'Add reference line'. Then you can select your calculation from the Value: dropdown and the scope too.

1 of 1 people found this helpful
• ###### 10. Re: Why isn't a simple sum function working?

For whatever reason that reference line won’t show actuals, just the average?

• ###### 11. Re: Why isn't a simple sum function working?

Average will show you the actual value. You can even verify the values.

1 of 1 people found this helpful
• ###### 12. Re: Why isn't a simple sum function working?

You can clearly see that for January my difference is 11499 and this is what is being shown on the reference line.

1 of 1 people found this helpful
• ###### 13. Re: Why isn't a simple sum function working?

THANK YOU SO MUCH!  I got it.

This was kind of important too…a request form a Sr VP.  I really, really wanted to give him the data in Tableau, NOT excel.

1 of 1 people found this helpful
• ###### 14. Re: Why isn't a simple sum function working?

You are welcome Ryan. I hope he gets impressed by your way of innovating the report which you need to provide him.

1 of 1 people found this helpful
1 2 Previous Next