
1. Re: IF/THEN/IFELSE Calculation returning incorrect results
maneesh.gaddam Feb 8, 2019 7:31 AM (in response to Justine May)Try adding
"IF ROUND([Minutes Between],0)"
There is a possibility of 1440 being 1440.xx so it is throwing it in >24 hours bucket

2. Re: IF/THEN/IFELSE Calculation returning incorrect results
Justine May Feb 8, 2019 7:37 AM (in response to maneesh.gaddam)Thank you very much for your assistance, but as I mentioned above these numbers are integers so there is no rounding issue at work

3. Re: IF/THEN/IFELSE Calculation returning incorrect results
Mihai Constantinescu Feb 8, 2019 7:49 AM (in response to Justine May)are you sure (try to Format and custom to 2 decimals) ? is that Minutes between another calculation? Can you attach a sample?

5. Re: IF/THEN/IFELSE Calculation returning incorrect results
maneesh.gaddam Feb 8, 2019 7:57 AM (in response to Justine May)You calculation looks good to me. Can you attach a sample workbook?

6. Re: IF/THEN/IFELSE Calculation returning incorrect results
Mihai Constantinescu Feb 8, 2019 8:03 AM (in response to Justine May)I've seen problems before with round(). Without a workbook I would suggest CEILING() or a MIN()

7. Re: IF/THEN/IFELSE Calculation returning incorrect results
Michael Gillespie Feb 8, 2019 8:16 AM (in response to Justine May)Justine, there is a difference between the precision of the numbers in the source data and the precision of the numbers when Tableau ingests them. You cannot rely on absolute 16decimalplace precision in Tableau without taking some additional measures.
This has to do with floatingpoint precision vs. wholenumber precision and other stuff that nonmathematicians like me struggle with.

8. Re: IF/THEN/IFELSE Calculation returning incorrect results
Justine May Feb 8, 2019 8:17 AM (in response to Mihai Constantinescu)As I mentioned before, I am working strictly with integers.
Since I apparently cannot be trusted to know what an integer is, I added the round function to reassure you.
Using CEILING() is impossible, because I am working with integers.
The ceiling function requires that the data type be float.
As I stated before, this is absolutely not a rounding problem as I am absolutely working with integers.
I cannot provide a workbook as this data includes PHI and I cannot reproduce the problem using the sample superstore dataset.
I would love to hear any other suggestions that you have, but it is unhelpful to presume that I do not know my data, or that I do not know what an integer is.

9. Re: IF/THEN/IFELSE Calculation returning incorrect results
Justine May Feb 8, 2019 8:23 AM (in response to Michael Gillespie)I have a masters degree in mathematics.
I know the difference between an integer and a float.
I know the difference between an integer and a rational number.This is not a rounding problem.

10. Re: IF/THEN/IFELSE Calculation returning incorrect results
Mihai Constantinescu Feb 8, 2019 8:26 AM (in response to Justine May)Justine, we were all trying to guess here what your problem is without seeing your data
Not sure why you took this personally it happens to all to miss something. Did you also try MIN() ?

11. Re: IF/THEN/IFELSE Calculation returning incorrect results
Justine May Feb 8, 2019 8:33 AM (in response to Mihai Constantinescu)When it was first suggested that I had a rounding error, I double checked, and confirmed that I did not.
After I confirmed that a rounding error is not the problem, it was suggested 4 times by 3 people that my problem was, in fact, a rounding error.
I'm trying to shift the conversation away from a problem I have already confirmed several times that I do not have.
Minutes are the lowest level of detail contained in these dates.
The data type is integer. What else could be the problem?

12. Re: IF/THEN/IFELSE Calculation returning incorrect results
Don Wise Feb 8, 2019 8:54 AM (in response to Justine May)Hi Justine,
I've run into your exact issue with response data for Fire and EMS response times. What appeared to be integers in my data was incorrect on my part. Unknowingly, until using DATEDIFF, we found that there were actually milliseconds in the original dataset but Tableau was displaying in conventional h:mm:ss.
When Tableau ingests it as Michael Gillespie noted, it is brought in differently apparently. Tableau does support displaying of milliseconds. Use Custom Format your date/time field as mm/dd/yy hh:mm:ss.000 to see if your time values contain milliseconds. If yes, you'll likely be able to see that the milliseconds is what's pushing your result values into the other bucket instead of the intended bucket.
I had to change some of my formulas to a different level of precision in order to handle that issue. So instead of 1440 minutes which represents 24hours. In your case, I'd make that entry in your calc as: <1440.0166666667 (which is equal to 1441 minutes to see if that works first? Adjust the level of precision accordingly thereafter so your next entry captures anything truly above 1440.
Just a thought!
Hope that helps! Thx, Don