Zeus Thunder
Zeus Thunder

Reputation: 21

Tableau - Dividing two calculated fields, getting wrong result of 1

I've been ripping my hear out trying to figure out why this is happening, any help would be very much appreciated!

I'm trying to divide the result of a calculated field by another calculated field in order to get a percentage ("X% of transactions were at or below SLA" essentially). Not sure if the problem is how I'm calculating the two fields, or this new calculation I'm using.

Here is the calculation I'm using: sum([CALC1]) / ([CALC2]) --I'm getting a result of 1 using this, but am expecting something like .982.

CALC1: IF [Total Time (seconds)] > 180 THEN 1 ELSE 0 END
CALC2: COUNT([Trans Id])

Upvotes: 2

Views: 6191

Answers (1)

Stephen Berndt
Stephen Berndt

Reputation: 433

I thought it would make sense to add this in the answers portion, even though the correct answer is listed in the comments.

The issue is with how you are displaying the answer. Right click on the measure in the left hand pane and scroll down to "default properties". Go to "Number format" and adjust to the desired number of decimal places.

Upvotes: 1

Related Questions