Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this snippet that generates the Master Time table which has all minutes in the day and from that generates hours field:
Master_time:
Load *,
Dual(Time(Floor(Time#([Order Time], 'hh:mm TT')), 'hh TT') ,hour([Order Time])) as [Order Hour]
;
LOAD
time(recno()/1440, 'hh:mm TT') as [Order Time],
time(recno()/1440, 'hh:mm TT') as [Order Time2],
minute(recno()/1440) as [Order Minute]
autogenerate(1440); // Generates every 1 minute
(I added [Order Time2] to be able to add it side by side with [Order Time] in a table box for demonstration)
and this line in the fact table extracts the time from ORDER_DATE and gets rid of the seconds.
Time(floor(frac(ORDER_DATE),1/24/60),'hh:mm TT') as [Order Time]
this should work, however, not all "times" values are linked it seems
here is a table box where I added [Order Time] and [Order Time2] and not all values are linked:
I even converted both fields to numbers to see the underlying values but that didn't help
What is going on? why aren't the values linked properly?
The time-generation between both sources is (slightly) different because the time-table field based on a pure division while the fact-table field has with floor(field, 1/24/60) a rounding. Just apply the rounding to the time-table, too and it should be working.