简体   繁体   中英

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])

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM