Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Setting a date format and using the date the calculate how long it's been since the date in the data

I have a dates that equal

 

6/24/2013 0:00

How do I define that this data is datetime format?

How do I find out what today is? Today()?

6 Replies
Highlighted
Specialist
Specialist

Date#(Field,'MM/DD/YYYY') to define and interpret that it's a date field in specified format.

yes today() to return present day.

Highlighted
Contributor II
Contributor II

Hi,

You need to use Date and Date# functions. Also, use script command 'SET DateFormat = .....' to setup right date format you want to use.

Example code will generate value '2017-06-24' in variable vDate:

//---------------

SET DateFormat='YYYY-MM-DD';

LET vDate = date(date#('6/24/2017', 'MM/DD/YYYY'))

//--------------

You are right - Today() function returns current date.

Regards,

Piotr

Highlighted
Not applicable

Try this ..

FRAC(date#(6/24/2013 0:00,'MM/DD/YYYY')) 

and today() function will return today date

Highlighted
Creator II
Creator II

Please Provide a Dummy Data

Highlighted
Creator II
Creator II

today()-floor(date#([DateField],'MM/DD/YYYY hh:mm'))

will give the number of days in the difference

Highlighted
Partner
Partner

Hi,

Today data is Today().

Date#(Floor(Field),'MM/DD/YYYY hh:mm')

Muthukumar Pandiyan