Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

Transact-SQL to QlikView code

Hi all there,

I'm a fairly new guy here in the QlikView community,

I'm having some difficulties putting a Transact SQL statement into QlikView.

Can someone give me an Idea in the right direction?

Statement:

CASE DUEBYTIME WHEN 0 THEN NULL

ELSE dateadd(s, datediff(s, GETUTCDATE(), getdate()) + (DUEBYTIME / 1000), '1970-01-01 00:00:00') END AS Verval_Datum

Thanks in advance.

4 Replies
Highlighted
Not applicable

Transact-SQL to QlikView code

Try with this:

(case when (DUEBYTIME=0) then Null() else dateadd(s, datediff(s, GETUTCDATE(), getdate()) + (DUEBYTIME / 1000), '1970-01-01 00:00:00') end) As Verval_Datum

Highlighted
Not applicable

Transact-SQL to QlikView code

Hi quique,

It seems Qlikview is troubled with te expressions:

dateadd(s, datediff(s, GETUTCDATE(), getdate())

ave you got there an QV alternative?

Thx in advance.

Highlighted
rohit214
Contributor III

Re: Transact-SQL to QlikView code

hi herman

try this

if(DUEBYTIME=0,Null(),Date(addmonths(datefield,'DD/MM/YYYY'),0)+(DUEBYTIME / 1000))As Verval_Datum

please specified that s,GETUTCDATE what are these fields or table name

thanks

rohit'

Highlighted
Not applicable

Transact-SQL to QlikView code

GETUTCDATE() is a transact SQL statement:

Microsoft writes:

Returns the current database system timestamp as a datetime value. The database time zone offset is not included. This value represents the current UTC time (Coordinated Universal Time). This value is derived from the operating system of the computer on which the instance of SQL Server is running.

Verval_Datum is a alias for a talbefield related to the field DUEBYTIME.

Greetz, Herman.