Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Daya_Qlik
Contributor II
Contributor II

Need help to write SQL syntax in Qliksense load script

Hi,

I want to write below SQL statement in Qliksense load script.

"if cast (to_char(((create_tms at time zone 'UTC') at time zone site.timezone_id), 'HH24MISS') as integer) between 000000 and 040000
then trunc(((o.created_at at time zone 'UTC') at time zone site.timezone_id))-1
else trunc(((o.created_at at time zone 'UTC') at time zone site.timezone_id)) end as lu_date"

 

Can someone please help me to write this into Qlik sense?

 

Thanks in advance.

 

Labels (2)
2 Replies
Digvijay_Singh

I am not good at SQL but this part ((create_tms at time zone 'UTC') at time zone site.timezone_id) is confusing to me, what are you expecting for that section?

Daya_Qlik
Contributor II
Contributor II
Author

Hi Digvijay,

 

Thank you for quick reply.

It converts the corresponding datetimeoffset value in the target time zone.

you can refer below link.

https://docs.microsoft.com/en-us/sql/t-sql/queries/at-time-zone-transact-sql?view=sql-server-ver15

 

Thanks.