Tableau Simples #4: Commenting in Calculated Fields

by Henry Mak

There’s a few reasons why you’d want to comment on your calculated fields, for example:

  1. To explain your calculation/code (to make yours and other people’s lives easier)
  2. To break down the calculation into multiple parts
  3. To disable parts of your calculation for debugging

In Tableau there are two types of commenting. Single line comments and multi-line comments. Here is how to do it:

Single Line Comment

In order to single line comment, simply add a // to the start of the line and write some text. Note: // doesn’t have to be at the very start of the text box.

You will notice that the text becomes grey, this means that Tableau recognises this as a comment and it will be ignored.

If you decide to make your comment more than one line, Tableau will not like it:

Notice how the text has become black and it is saying that the calculation contains errors. This is not good. To fix this you have to create a multi line comment.

Multi Line Comment

To create a multi line comment you have to put /* at the start of your comment and */at the end of your comment. See below screenshot.

The problem is now fixed (from screenshot 2) and all is good.

Tableau Public