jerH
jerH

Reputation: 1299

How can I add a calculated field to a Tableau data table?

I have a dashboard that looks at the time it takes the FDA to issue follow-up actions after inspecting a facility. In the screenshots below I've blurred the details, I've made a notional data set dashboard here.

My main question has to do with adding a calculated field to a data table. As you can see below, I have a tooltip that shows you the percent change in the first and last values in the row when I hover over it.

enter image description here

Ideally I'd like that to just be a column at the right end of the table.

In addition, that value is calculated as

enter image description here

If I select multiple program areas, and one of them is missing data, the tooltip no longer works for that row

enter image description here

Final question (for now) In my production file you can see the tooltip is formatted as a percentage. I have no idea how I did that! In the notional book attached you'll see that they are decimals. Where does one control that?


Upvotes: 0

Views: 35

Answers (1)

Alex Blakemore
Alex Blakemore

Reputation: 11921

For handling missing data, you have to decide what you want the calculation to do in that case - either data rows with null columns or missing data rows altogether. Then use functions like IF_NULL, ZN() and IS_NULL to specify the result you want. For marks, such as lines, you can also control how missing values are handled from the format pane

For your formatting question, if you right click on your calculation on the marks card, it probably has the details icon next to it, you can select format and then set the Number format to percentage

Upvotes: 0

Related Questions