I'm trying to calculate the amount of days between two dates (note: one of them is in datetime format, and the other is date)
Later I'm using a formula tool to classify everything that is below 44.50, but I'm having the following issue;
It seems like .50 is not being considered in my formula tool. No matter if I have 44.51 or 44.49 alteryx will say it is 44.
Decimals are important to me in this situation. I need to filter out everything that has less than 44.49 days. 44.50 an above should be kept.
I have tried to change the format in the screenshot above to fixed decimals, but it didn't work out either. Any thoughts on how I can troubleshoot this?
Second issue I'm having is that if I remove the tonumber from the screenshot above alteryx returns the following error:
Solved! Go to Solution.
Hi @jackersantos ,
The datetimediff gives you only an integer response, so if you want to have your result in decimals, I suggest you to calculate the difference in minutes and then divide it per 60*24 (minutes*hours) to give you the same answer but with decimals.
Your another issue is related to the "Sem data" possibility transforming your field in a string column.
BEst,
Fernando Vizcaino
I think the issue is that the DateTimeDiff function only returns results in whole numbers, so it will return 1 or 2 or 3 days, but not 1.5 days. If you need greater granularity, you'll have to select the unit as 'hours' and convert it to days yourself.
@fmvizcaino @DavidP thank you so much for your help. I resolved it by using hours in DatetimeDiff then dividing this by 24 and using 'round' formula to round the number. At the end I got what I need (44.49 and below is out of my analysis and the rest is in).