Chuyển tới nội dung
Trang chủ » Comment In Tableau Calculated Field Top 5 Favorites

# Comment In Tableau Calculated Field Top 5 Favorites ## View information about the comment in tableau calculated field

• Question: comment in tableau calculated field
• Time: Asked 38 days ago
• Modified: Updated 211 hours ago
• View: 9899

### comment in tableau calculated field

To add a comment in a Tableau calculated field, you can use the double forward slash (`//`) to indicate the start of the comment. Anything written after the double forward slash will not be considered as part of the calculation.

For example, suppose you have a calculated field that calculates the average sales of a product:

scss
```AVG([Sales]) ```

To add a comment explaining what this calculation does, you can modify the calculated field as follows:

scss
```// Calculates the average sales of a product AVG([Sales]) ```

When you save the calculated field, the comment will be included in the formula, but it will not affect the output of the calculation.

Adding comments to your calculated fields can be useful for yourself or other users who may need to understand the logic behind your calculations.

### Watch videos related to “comment in tableau calculated field”

Calculated Fields in Tableau (Formulas & IF Statements) – Tableau Tutorial P.6

## Images related to comment in tableau calculated field

Found 27 comment in tableau calculated field related images.

### multi-line comment in tableau calculated field

In Tableau, you can create a multi-line comment in a calculated field by using the forward slash and asterisk to start the comment and the asterisk and forward slash to end the comment. Here’s an example:

javascript
```/* This is a multi-line comment in Tableau You can write multiple lines of text here */ ```

Any text between the forward slash and asterisk and the asterisk and forward slash will be ignored by Tableau, allowing you to add comments and notes to your calculated field without affecting the output.

### tableau calculated field comment block

Tableau does not have a specific syntax for creating a comment block in a calculated field, but you can add comments to your formula using the // or /* */ syntax. Here are two examples:

1. Using // to add a comment to a single line:
scss
```SUM([Sales]) // This calculates the total sales for each category ```
1. Using /* */ to add a comment block spanning multiple lines:
scss
```/* This formula calculates the average profit margin for each region and excludes any negative profit margins */ IF AVG([Profit]) >= 0 THEN AVG([Profit]) / SUM([Sales]) END ```

Note that comments in Tableau calculated fields are not executed and do not affect the results of the calculation. They are purely for documentation purposes and can help you and others understand the logic of your calculation.

You can see some more information related to comment in tableau calculated field here

There are a total of 790 comments on this question.

As an AI language model, I do not have access to real-time information on internet forums or websites, so I cannot provide you with the top 5 favorite comments in Tableau calculated fields at this moment.