Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
nigelapt
Contributor III
Contributor III

Qlik Sense

Hi folks

I am having difficulty getting QlikSense to recognize a timestamp as a valid timestamp.

I am loading performance data from SQL to a temporary table:

SET TimestampFormat='YYYY-MM-DD hh:mm:ss.ffffff';

LIB CONNECT TO '01-PRD-SQLSERVER';
 
PERFDATA_Temp:
SQL SELECT
Perf.vPerfHourly.DateTime AS [08 Sample Date/Time],
FROM
dbo.vPerformanceRule WITH (NOLOCK) 
Disconnect;
 
The data loads as follows to the temp table eg:
nigelapt_1-1723586841478.png

 

I then want to extract the timestamp and date etc from the temp data and write to a new table.

PERFDATA:
Load
Timestamp(Timestamp#([08 Sample Date/Time], 'YYYY-MM-DD hh:mm:ss.ffffff'), 'YYYY-MM-DD hh:mm') as [Sample Date/Time],
Date(Timestamp#([08 Sample Date/Time], 'YYYY-MM-DD hh:mm:ss.ffffff'), 'YYYY-MM-DD') as [Sample Date]
Resident PERFDATA_Temp;
 
Drop Table PERFDATA_Temp;

 

However the function fails and this is what is returned:

nigelapt_2-1723587322940.png

 

I am not sure what I am doing wrong.

Any advice would be greatly appreciated.

Thanks

Nigel

 

 


 

 

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@nigelapt  tty to trim the spaces

 

PERFDATA_Temp:
LOAD trim([08 Sample Date/Time]) as [08 Sample Date/Time];
SQL SELECT
Perf.vPerfHourly.DateTime AS [08 Sample Date/Time],
FROM
dbo.vPerformanceRule WITH (NOLOCK) 

View solution in original post

4 Replies
poklegoguy
Creator
Creator

Can't really find any fault in your script, I used the identical script as yours but mine worked. 

anat
Master
Master

Can you try using floor function

Date(floor (field)) as date, 

Timestamp (floor(field)) as datetime

Kushal_Chawda

@nigelapt  tty to trim the spaces

 

PERFDATA_Temp:
LOAD trim([08 Sample Date/Time]) as [08 Sample Date/Time];
SQL SELECT
Perf.vPerfHourly.DateTime AS [08 Sample Date/Time],
FROM
dbo.vPerformanceRule WITH (NOLOCK) 
nigelapt
Contributor III
Contributor III
Author

Many thanks Kushal! That sorted it!