Understanding the significance of Colors in a Calculation Editor in Tableau

Deepak Holla
3 min readNov 8, 2023

--

Typical conversation regarding the significance of Colors in a Calculation Editor

In Tableau we can see a lot of visual cues or icons in order to make the interface as intuitive as possible to the user.
Among all the cues the most popular one (and mostly the first that anyone new to Tableau will come across) is without a doubt the blue and green ‘pills’ that indicates if a field is discrete or continuous respectively.

There are other less obvious visual cues that can help speed up the analyzing phase.

The best example for this is to understand the Colors in a Calculation Editor. These colors will help in first understanding the calculation and in eventually debugging any issues that we may encounter while working with calculated fields.

In total there are six text colors that we may come across inside a Calculation Editor. The fields in the calculation editor are color coded by field type.

The below image provides a visual summary of the various colors in a standard Calculation Editor in Tableau.

Colors in a Calculation Editor in Tableau

Given below are the different colors and their description:

  1. Comments & Strings: Grey
    Any in-line notes/comments will be displayed in grey. Comments will be preceded with a ‘//’ i.e. two forward slashes. Multi-line comments can be added by typing ‘/*’ to start the comment and ‘*/’ to end it.

Even generic Strings that are a part of a formula are displayed in the same shade of grey.

2. Parameters: Purple
Parameters will be displayed in purple.
In case the Parameter has the same name as any other field in the design then to avoid any confusion Tableau appends [Parameters] to the parameter field. e.g: [Parameters].[Parameter Name].

3. Field Names: Orange
The field can be a dimension, set, or measure.
This is helpful in case we have a field that is not showing up as orange.
The possible reason might be misspelling hence Tableau is not able to recognize it as a Field.

4. Calculation Functions: Blue
Calculation Functions will be displayed in Blue color.

NOTE 1: One careful point that needs to be considered here is that just because the text is blue it doesn’t conclude that it is valid function

NOTE 2: The curly brackets {} for Level of Detail expressions, will also appear in blue. The example in this article does not show a LOD expression in the Calculation Editor.

5. Text that are not comments: Black
These are any notes that are not preceded with a ‘//’ i.e. two forward slashes or within ‘/*’ and ‘/*’ .
The black color indicates that Tableau doesn’t recognize it as a comment or a string.

6. Errors: Red
Like spell-check, errors in calculated fields are underlined in red squiggles
The error message is also displayed in red color.

I hope this article is useful for all Tableau users especially for anyone just starting their Tableau journey!!!

--

--

Deepak Holla

Recently made a transition into the field of Data Analytics. Have been featured in multiple Tableau DataFam Roundups..