Using datediff on timestamps

I am trying to use a calculated field to find the datediff between two timestamps.

This is an image of what I’ve been able to accomplish so far using tables as visualizations

The ‘last parts’ column is finding the max datetime <12:00PM where the measure ‘goodparts’ /= 0. The ‘first parts’ column finds the min datetime > 12:05PM where the measure ‘goodparts’ /= 0.

I want to use a calculated field to automate this process, so that I don’t need to use the visualizations. The method I have used previously is exporting these tables to Excel and subtracting the ‘first parts’ column’s datetimes from the ‘last parts’ column’s datetimes, but I have been unsuccessful using a calculated field in Quicksight so far.

If anyone has any direction for me I would be very appreciative!

Hi @linchoff

did you already try to use the datediff function?

BR

1 Like