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

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

How to convert Date into Number(int)

Hi All,

I was wondering how to convert DateTime field into Number(Int not decimal)

TestTemp:
load * Inline
[
TestDate
2010/01/01 12:13:00
];

load num(TestDate) as DateNum Resident TestTemp;

But you can see that the TestDate has time, so how to get the int number with num function?

Many thanks.

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi,

You are able to use

Floor( Date ( Today( ) , 'DD/MM/YYYY' ) )

Let me know

Rgds

Anand

View solution in original post

7 Replies
its_anandrjs
Champion III
Champion III

Hi,

Use Date#( Datefield ) as NumDate to convert date into num

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

You are able to use

Floor( Date ( Today( ) , 'DD/MM/YYYY' ) )

Let me know

Rgds

Anand

SunilChauhan
Champion II
Champion II

try this

TestTemp:
load * Inline
[
TestDate
01/01/2011 12:13:00
];

load num(TestDate) as DateNum Resident TestTemp;

format of date should be same as format defined using set in start of edit script

Sunil Chauhan
its_anandrjs
Champion III
Champion III

Hi,

See the attached sample file.

Your inline date is not in date format.

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Let see your date example for this date 2010/01/01 12:13:00 in sample file.

Let me know about this.

Rgds

Anand

SunilChauhan
Champion II
Champion II

only you need to match the format of date given in load statement and format of date defined in start of coding.

both should be same

see my post above

Sunil Chauhan
its_anandrjs
Champion III
Champion III

Hi,

Hope you got correct answer, if so mark it correct\Helpful on post to complete the thread.

Rgds

Anand