Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Most used date functions

Hi all ,i need most used date functions in QV with examples ,,, can any one reply .. examples must be simple understanding method ,please reply

11 Replies
Not applicable
Author

you should check this in the qlikview help. there all functions descriped pretty good and understandable.

regards,

MT

vijetas42
Specialist
Specialist

martinpohl
Partner - Master
Partner - Master

Examples:

date(datefield,'YYYY-MM-DD') as date -> load the field datefield and formats it into YYYY-MM-DD

date(date#(datefield,'YYYYMMDD'),'YYYY-MM-DD') as date -> load the field datefield with formatted YYYYMMDD and formats it into YYYY-MM-DD

year(datefield) as year -> returns the year from the datefield

year(date#(datefield,'YYYYMMDD')) as year -> returns the year from the datefield formatted YYYYMMDD

so there are many examples, look at the help / time functions

Not applicable
Author

What is the use of date() and Date#() will any one  explain,,, with simple examples

its_anandrjs

I think you got correct answer from the thread so mark the thread as correct or helpful for others reference.

Regards

martinpohl
Partner - Master
Partner - Master

with date(datefield,'YYYY-MM-DD') you set the format settings from the field to the defined format (to use on visualation e.g. in listbox)

with date#(datefield,'YYYY-MM-DD') you set the format of the format settings from the field which are not equal to your standard settings of the os.

The syntax in words:

load the field datefield as a date field but the format of this field is YYYY-MM-DD

Regards

its_anandrjs

Suppose you have date as format 30042014 which is not in the date format so for date format you need to convert it into date format  but first in current format convert it into date number like

Date#(3004214,'DDMMYYYY')  So you convert this into 30042014 date format

and after that if you want to convert its date format then use

Date(Date#(3004214,'DDMMYYYY'),'DD/MM/YYYY')

Not applicable
Author

Thanks