Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Timestamp# issue

Hi Guys

I have a simple testing code

let cdate = Timestamp('41541.7729050926');

// cdate is 2013-09-24 18:32:59

let gdate = Timestamp#(cdate);

I am expecting gdate to be '41541.7729050926' but it just same as cdate i.e. 2013-09-24 18:32:59.

what wrong am i doing here?

Saurabh

1 Solution

Accepted Solutions
swuehl
MVP
MVP

First, you need to use a number as argument to Timestamp(), not a string,


let cdate = Timestamp('41541.7729050926');

won't assign anything to cdate, use

let cdate = Timestamp( 41541.7729050926 );

Then, Timestamp#() is interpreting a string and setting the numeric representation, but it will return the text representation in this context (and the variable will only hold the text representation, no dual value).

You'll need to use num() function to get the numeric representation:

let gdate = num(Timestamp#(cdate));

Please have a look also into http://community.qlik.com/docs/DOC-3102

View solution in original post

3 Replies
swuehl
MVP
MVP

First, you need to use a number as argument to Timestamp(), not a string,


let cdate = Timestamp('41541.7729050926');

won't assign anything to cdate, use

let cdate = Timestamp( 41541.7729050926 );

Then, Timestamp#() is interpreting a string and setting the numeric representation, but it will return the text representation in this context (and the variable will only hold the text representation, no dual value).

You'll need to use num() function to get the numeric representation:

let gdate = num(Timestamp#(cdate));

Please have a look also into http://community.qlik.com/docs/DOC-3102

Not applicable
Author

Thanks...

It works...

preminqlik
Specialist II
Specialist II

let gdate = num#(Timestamp#(Timestamp('41541.7729050926')));