Negative numbers being captured in date diff explore?Répondu
So I've created a date diff query for capture the amount of days between a custom attribute which is the ticket created date vs their installation date:
IF (DATE_DIFF([Ticket created - Date],[Install date - Date],"nb_of_days")>30) THEN FALSE ELSE TRUE ENDIF
It works well but it is also capturing negative numbers on the true part of the query when I drill in.
Any ideas on how I can fix this?
Hi Jack Gordon, that is happening because the install date is greater than the ticket creation date for those cases, and because negative values are less than 30, the formula returns TRUE.
If you want to exclude these cases (i.e. considering negative values as FALSE), I'd suggest modifying the formula to:
IF (DATE_DIFF([Ticket created - Date],[Install date - Date],"nb_of_days")>30)
OR ([Install date - Date] > [Ticket created - Date])
Hope this helps!
One slight error, you have placed 2 brackets on the end of the second line, when removing one works perfect.
Hi Jack, I'm glad it worked! And good catch on that extra bracket, thanks for the heads up (corrected it in the previous comment).
Vous devez vous connecter pour laisser un commentaire.