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: 
Not applicable

Date dont show year month day I can only se Year = 1900, Month = mar, Day = 28

I can't get Date to show me YEAR MONTH DAY

My script:
I use this script and it run Okay - import from a file on a homepages but it is the same if I try to import from the computer C:\xxx.txt

Tab1:
Load *, Month(Dato) as Måned;
Load *, Year(Dato) as År;
Load *, Day(Dato) as Dag;

Load
@1 as Nummer,
@2 as KundeID,
@3 as Type,
@4 as IPadresse,
@5 as Dato
FROM

My data - some of it taken from Notepad-file.



463,170,4,66.249.65.243,15:34:42 27-04-2010
1297,679,2,212.242.59.140,15:35:10 27-04-2010
1297,679,3,212.242.59.140,15:35:14 27-04-2010
1297,679,2,212.242.59.140,15:35:46 27-04-2010
583,289,2,207.46.199.46,15:39:57 27-04-2010

The result

error loading image

I would be very greatfull if there is anyone who have the answer

Thank you

Best regards

John Thinggaard Andersen

8 Replies
boorgura
Specialist
Specialist

Hey John,

Not sure if you have the script right.

I see that you have the Year, Month and Day before loading the date from the text file.

I'd assume it has to be done after loading the data from the text file.

Not applicable
Author

Or try that

Tab1:

Load
@1 as Nummer,
@2 as KundeID,
@3 as Type,
@4 as IPadresse,
@5 as Dato,

Month(@5) as Måned;
Load *, Year(@5) as År;
Load *, Day(@5) as Dag;
FROM

Not applicable
Author

Hi Rocky

I did not change anything and I have others scipt where it is ok to have it before the data

I think that there is a problem about that the timestamp is before the date because I have a similar file who works fine and here the date is before the timestamp.

Thank you for your answer

Have a nice day

Best regards

John

Not applicable
Author

Hi Seif eddine

It did nok solve my problem - It will not accept @5 it has to be Dato!

I think that there is a problem about that the timestamp is before the date because I have a similar file who works fine and here the date is before the timestamp.

Thank you for your answer

Have a nice day

Best regards

John

Not applicable
Author

Have you tried something in the line with (it works for me in my application)

num(Year(Dato)) as Year,

num(Month(Dato)) as Month,

num(Day(Dato)) as Day,

Anonymous
Not applicable
Author

John,
The script doesn't recognize this format as date/time. You have to define it explicitly:
timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')
So, it may be like this:
date(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Date,
month(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Month,
Year(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Year,
...

Not applicable
Author

Hi DK ASN

I have tryed your answer but it dont solve the problem

Now result is that month changes from mar to 3

Thank you very much for your answer and help

Have a nice day

Best regards

John

Not applicable
Author

Hi Michael Solomovich

You just saved my day - thank you very much - now it works - GREAT YesCool - cant thank you enought

Now my script look like this

and the result look like this

Thank you all who have help me with this solution !!!

Have a nice day

Best regards

John