cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Function UTCTOLOCAL in HANA Calculation View

TanmayVerma
Active Participant
0 Kudos

Hi All,

I am using UTCTOLOCAL to convert UTC time to local time as per the timezone in a calculated column of a calculation view.

Below is the parameters the function support:

UTCTOLOCAL(time, timezone)

However , i wanted to pass the data set to be used as well. I can see that it is supported as per the SQL Reference guide and i am able to execute the same in SQL console as well.

Syntax as per the SQL Reference guide:

LOCALTOUTC (<time> [, <timezone> [, <timezone_dataset>]])

Successfully Executed query by passing the dataset as 'platform'

SELECT UTCTOLOCAL ( CURRENT_UTCTIMESTAMP, 'Africa/Abidjan' , 'platform') "utctolocal" FROM DUMMY;

Any idea why the function provided by expression editor does not support passing the dataset ?

I wanted to perform this in a view itself and not wanted to write a procedure which i guess will support passing of dataset.

Any pointers will be helpful.

Regards,

Tanmay

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Unfortunately the dataset parameter is not (yet) released for the usage in the data modelling area. As you mentioned one option is to create a table function which provides the data in the way you need it and use it as data source in a projection (in the table function the dataset parameter can be set of course). Another option would be to create a SQL view which provides you converted timestamp. In an SQL view you can use the UTCTOLOCAL function with the parameter dataset too.

TanmayVerma
Active Participant
0 Kudos

Hi Florian,

Thanks for your response. This makes it clear. I will proceed with other options suggested.

Regards,

Tanmay

Answers (0)