-
1. Re: How to display the percent difference between 2 columns in a third column?
Deepak Rai Nov 29, 2017 1:38 PM (in response to Jessie Black)-
percent_diff.twbx 1.2 MB
-
-
2. Re: How to display the percent difference between 2 columns in a third column?
Jim DehnerNov 29, 2017 1:43 PM (in response to Jessie Black)
1 of 1 people found this helpfulHi Jessie
there is a table calculation that does that - Percent Difference
it will return this
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
-
3. Re: How to display the percent difference between 2 columns in a third column?
Jessie Black Nov 29, 2017 1:44 PM (in response to Jessie Black)Thank you!
How do you get the SUM (2015) and SUM (2016)?
-
4. Re: How to display the percent difference between 2 columns in a third column?
Jim DehnerNov 29, 2017 1:51 PM (in response to Jessie Black)
Jessie
the sum is created by dragging sales to the viz and it will aggregate there - the default is Sum()
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
-
6. Re: How to display the percent difference between 2 columns in a third column?
Jim DehnerNov 29, 2017 2:22 PM (in response to Jessie Black)
Thanks
Glad to help out
If you haven't tried the on-line video training they real are good - I would suggest Calculations
see the link Tableau Training and Tutorials
Jim
-
7. Re: How to display the percent difference between 2 columns in a third column?
Jessie Black Nov 29, 2017 2:52 PM (in response to Jim Dehner)I will definitely take a look a the videos!
How were are your original values for 2016 and 2017 columns still visible?
-
8. Re: How to display the percent difference between 2 columns in a third column?
Jim DehnerNov 29, 2017 2:55 PM (in response to Jessie Black)
1 of 1 people found this helpfulJust leave both Sum Sales and the table calc for the % difference in the view - you need to put in Sales convert it to a table calc and then add Sum sales back in a second time
Jim
-
9. Re: How to display the percent difference between 2 columns in a third column?
Jessie Black Nov 29, 2017 3:05 PM (in response to Jim Dehner)THANK YOU!!!
-
10. Re: How to display the percent difference between 2 columns in a third column?
Jessie Black Nov 29, 2017 3:13 PM (in response to Jim Dehner)Now that I figured it out, I'm getting picky. Is there a way to color code the percent difference column? Ideally where everything under 32% is green and everything over 32% is red?
-
11. Re: How to display the percent difference between 2 columns in a third column?
Jim DehnerNov 29, 2017 3:28 PM (in response to Jessie Black)
OK now you are going for the advance course
first add a calculation shown below - it is nothing but the % difference table calculation from before
The easy way to get the formula is to just drag the green pill off the measure value card - it will change the name to calculation 1
then go to the measures frame and find calculation 1 and re-name it as shown - I just needed a calculated field for step 2
then create another calculation
This is nothing but a field to separate based on the percentage you want and group the values into 2 bucket called red and green
The bucket names do NOT create the color
For that
Put you color indicator on the color tile
Then click on the tile and edit color - it will open the second box and the little colored squares will not be the correct color
click on the square and then select the color from the pallet you want
When done click ok (also Note best practice is to NOT use red/green - too many color blind people - Blue / Gold - Red /Black are better
Jim
-
color coding_v10.2.twbx 1.2 MB
-
-
12. Re: How to display the percent difference between 2 columns in a third column?
Tyler Garrett Nov 29, 2017 3:42 PM (in response to Jessie Black)Percent difference needs to be aimed a direction. Here you're using table across.
Okay you can see below, I have the same problem as you are having! Have no fear, literally everyone has this same problem. You need to include 2012 data to ensure this 2013 field is NOT blank. But technically speaking, below is showing you the correct difference between 2013 and 2012... Zero - which is NULL, and not showing a value.
Have no fear, they have a 'HIDE' based on your right click. So right click, and say bye bye 2013!
If you're filtering 2012, then don't do that anymore. Hide it because the logic will play out against you
If you don't have 2012 data, let me know - there's an easy sql solution to 'pad your data.' And it's very easy. Let us know.
best,
tyler