Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My data has columns: ID, Date_Time (both Date and Time). I'm trying to create a bar chart, with Hours (civilian format) as dimension, count(ID) AS measure.
My script is like:
LOAD ID, timestamp(Date_Time, 'h TT') AS Hour...
But my bar chart shows duplicates in dimensions as below:
Any idea why? And how should I fix this?
Thanks in advance!
The apparent duplicates will be due to the date part of Date_Time being different. Try:
timestamp(frac(Date_Time), 'h TT') AS Hour
Hi there,
I gave it a go, still have duplicates.
I got this by using Time#(Time(Date_Time,'h TT')), but I have no idea why...
Your function is using Time() to convert the underlying data into a time format for display and Time#() to convert that display value into a time. It's effectively rounding the the time component to the preceding hour.
My previous (incorrectly) suggestion assumes your time components are already rounded to the hour.