Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Thanks in advance
Hi ,
i am new to qlik.
having column name DAY_KEY in integer format (20161227) want to convert in date format.
can anyone suggest solution.
=date(date#(DateField,'yyyymmdd'),'yyyy-mm-dd')
Hi,
you could try with
Date(Date#(DAY_KEY,'YYYYMMDD'))
to convert into your default DateFormat, or
Date(Date#(DAY_KEY,'YYYYMMDD'), 'MM/DD/YYYY')
to get another format as required.
Pay attention to use upper case MM instead of mm in this case as the latter means minutes instead of months. Although looking the same, the result might be wrong (different underlying numerical values).
hope this helps
regards
Marco
Hi,
Date#() will convert your integer format to Date format.
Ex:-
The Date# function formats any given string which holds a date to a valid date format
e.g. Date#('2015-08-18','YYYY-MM-DD')
The Date() formats a valid date field to your liking
date('2015-08-18','MM/YY') will Show 08/15
if you got the solution for your issue,please close the thread by clicking "Correct Answer"
The examples below assume the two following operating system settings:
Default setting 1 | Default setting 2 | |
Date format | YY-MM-DD | M/D/YY |
date( A ) where A=35648 returns:
Setting 1 | Setting 2 | |
String | 97-08-06 | 8/6/97 |
Number | 35648 | 35648 |
date( A, 'YY.MM.DD' ) where A=35648 returns:
Setting 1 | Setting 2 | |
String | 97-08-06 | 97-08-06 |
Number | 35648 | 35648 |
date( A, 'DD.MM.YY' ) where A=35648.375 returns:
Setting 1 | Setting 2 | |
String | 06.08.1997 | 06.08.1997 |
Number | 35648.375 | 35648.375 |
date( A, 'YY.MM.DD' ) where A=8/6/97 returns:
Setting 1 | Setting 2 | |
String | NULL(nothing) | 97.08.06 |
Number | NULL | 35648 |
date(date#(DateField,'yyyymmdd'),'MM-DD-YYYY')
Date is formatting function.
Date#() is used how to interpret the data.
By this function we need to tell to qlikview how your date format is...('yyyymmdd')
By Date function we convert this .'yyyymmdd' into 'MM-DD-YYYY'
so result will be 12-27-2017(dec 12th 2017)
Hi,
try this,
=Date(MakeDate(Mid('20161227',1,4),Mid('20161227',5,2),Mid('20161227',8,2)),'DD-MMM-YYYY')
please close your thread if your question is answered
Qlik Community Tip: Marking Replies as Correct or Helpful
thanks
regards
Marco
date(Date#(DAY_KEY,'YYYYMMDD'), 'MM/DD/YYYY')
Try this Expreesion inn your script:
Date(DAY_KEY,'DD-MM-YYYY') as Datekey