Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tomcatxx
Creator
Creator

1 field in 2 columns Load?

Hello there,

I have a column of Table like this.

Time
3/12/2015 00:21
12/11/2014 01:12
1/5/2014 00:32
...

I want to load that in 2 columns like this. The loaded Date has a same length.

DateTime
03/12/201500:21
12/11/201401:12
01/05/201400:32
......

Have u a ideal? Thanks.

14 Replies
tomcatxx
Creator
Creator
Author

Yes, u are right. If I use Date() or TimeStamp() to get 2 columns, 'Date' and 'Time' looks like only date and time. But value of 'Date' contains also date and time. If u look value of 'Date', u get that.

MinMax:
Load
min(Date) as minDate,
max(Date) as maxDate
Resident Table;

-----------------------------------------------

MinMax:

minDate                           maxDate

42079,521455158            42072,995261815

So I cant use 'Date' to make a master Calendar. I think that  SubField(Time,' ',1) as Date is better.

tomcatxx
Creator
Creator
Author

Thank you. It works.

sunny_talwar

I think you can truncate the time component (the decimal) by using Floor() function in your main fact table

Date(Floor(Date)) as Date

Similarly, you can use Frac to remove the Date from your timestamp

Time(Frac(Date)) as Time

tomcatxx
Creator
Creator
Author

Cool, it works.The value is also date format now.

sunny_talwar

Awesome