Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ramajola
Contributor III
Contributor III

Date/Time format in Load Script

Hi guys, i'd like load a date/time in Load Script in this format hh:mm but in the extraction phase value return in this mode. What can i do to have a similar format? 7:00 - 8:00 - 9:00 - 10:00

Cattura.PNG

In load script, I transform value with  "Interval(ORARIO, 'hh:mm') as [Orario]," but isn't correct.

May you help me? 

Thanks in advance

 

 

 
 

 

 

2 Solutions

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

Try this

interval(num#(Orario,'####')/2400,'hh:mm') as Orario,

View solution in original post

Vegar
MVP
MVP

Your field was not numeric. I guess they have a blank sign in the beginning or end. I solved this by using trim()

See example script below where the maketime expression (Orario1) seems to give correct output:

 

SET TimeFormat='hh:mm';

NoConcatenate
Test:
LOAD
  "Data Elaborazione",
  "Ora dalle",
  "Ora alle",
  "Codice filiale",
  Orario,
  Time#(trim(Orario), 'hh:mm') as Orario2,
  maketime(Floor(trim(Orario)/100)) as Orario1
FROM [lib://DateTimeFormat (laptop-afr743rk_vegar)/Test.qvd]
(qvd);

image.png

View solution in original post

8 Replies
lorenzoconforti
Specialist II
Specialist II

Try this:

Time#(ORARIO, 'hh:mm') as [Orario],

Ramajola
Contributor III
Contributor III
Author

Hi, thank you for your response, but it's not working.

The result is the same. I woud like to have 7:00, 8:00, 9:00.

Any suggestions?

Thanks

 

 

lorenzoconforti
Specialist II
Specialist II

It's working for me (see below and attached)

Where did you get the screenshot you posted above? It doesn't look like Qlik Sense

Also, have a look at the Data model viewer to check how data is actually being managed (maybe post a picture of the Data model viewer, of that specific field)

 

Orario.png

Vegar
MVP
MVP

Try this to make your time field

 MakeTime(Floor(ORARIO/100)) as Orario

Ramajola
Contributor III
Contributor III
Author

I've attached my .qvd and my .qvf. In both cases, it's not working.

In the previous one, I showed date by Qvd Viewer.

 

lorenzoconforti
Specialist II
Specialist II

Try this

interval(num#(Orario,'####')/2400,'hh:mm') as Orario,

Vegar
MVP
MVP

Your field was not numeric. I guess they have a blank sign in the beginning or end. I solved this by using trim()

See example script below where the maketime expression (Orario1) seems to give correct output:

 

SET TimeFormat='hh:mm';

NoConcatenate
Test:
LOAD
  "Data Elaborazione",
  "Ora dalle",
  "Ora alle",
  "Codice filiale",
  Orario,
  Time#(trim(Orario), 'hh:mm') as Orario2,
  maketime(Floor(trim(Orario)/100)) as Orario1
FROM [lib://DateTimeFormat (laptop-afr743rk_vegar)/Test.qvd]
(qvd);

image.png

Ramajola
Contributor III
Contributor III
Author

Thank you guys, now it's worked for me.

Thank you for your patience e for all support!