Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all ,i need most used date functions in QV with examples ,,, can any one reply .. examples must be simple understanding method ,please reply
you should check this in the qlikview help. there all functions descriped pretty good and understandable.
regards,
MT
Read this master calendar document there you find all date functions
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar
Or
Or
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
What is the use of date() and Date#() will any one explain,,, with simple examples
I think you got correct answer from the thread so mark the thread as correct or helpful for others reference.
Regards
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
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')
Thanks