Making the most of comments

These are tips 7-9 of my Tableau Speed Tipping session. Refer to the Table of Contents to find the other tips.

  1. Hold Alt+drag to select characters underneath each other in calculations to remove comments

When you are still working on your calculated fields, you might have some old calculation left in there that is commented out. If that calculation stretches over multiple rows, removing the two slashes at the beginning of each row is quite tedious. Wouldn’t it be super helpful if you could simply highlight characters underneath each other? Well, you can – simply press your ALT-key and do it.

Many thanks to Vince Baumel for showing this trick at the Tableau Tip Battle at TC19 in Vegas!

  1. Rename ad-hoc calcs using comments

Some chart types, such as donut charts, require you to use a helper axis or two. You usually don’t have a particular desire to add the calculations to your data source, so you might simply use ad-hoc calcs instead. The trouble is that your marks card might get confusing, especially when your helper axes all have the same calculation, as they usually do.

In this instance, it might be helpful to assign these helper calcs a title without necessarily persisting them. And you can do that! Simply double-click on the pill in your columns container (or wherever you have your helper calc), move the cursor to the very first position in the calculation, add two slashes followed by the desired title, add a line break using Shift+Enter, press Enter again to exit, and there you go: the pill title changes, as do the axis title and the marks card.

  1. Automatic renaming of persisted fields using comments

With the above tip, you have the added benefit that when you decide that you actually want to persist these ad-hoc calcs after all, you can simply drag them from the view over into your data pane. Usually Tableau would now prompt you to name your field. But if you’ve already added a comment to your ad-hoc calculation, Tableau will simply grab that comment and assign it as field name.

The same goes for whenever you should find yourself with multiple calculations in the same calculated field. Simply type in a comment to use as field name, highlight all rows of a calculation within edit box, and drag those rows to the data pane. Tableau will create a new calculated field with the highlighted rows, and name it according to the comment. Lindsey Poulter demonstrated this admirably in the 2019 Iron Viz finale.