pavanqlik
Contributor II
2016-05-09
12:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Issue with date format, i have date field with format 5/12/2015 as string and 20150205 as number need to convert it to MM/DD/YYYY format
Hi,
I had a date field with some rows in excel
1) 1-8 it shows as string M/DD/YYYY
2) 9-10 it shows as text YYYYMMDD
Could you please help me in converting this into 'MM/DD/YYYY' format.
Thanks,
Pavan
654 Views
2 Replies
qlikmsg4u
Specialist
2016-05-09
12:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
Load *,Date(Alt(Date#(Date,'MM/DD/YYYY'),Date#(Date,'YYYYMMDD')),'MM/DD/YYYY') as Date1;
LOAD * INLINE [
Date
01/01/2016
01/02/2016
01/03/2016
01/04/2016
01/05/2016
20160106
20160107
20160108
20160109
20160110
];
Not applicable
2016-05-09
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
In load script,
Date(Alt(Date#(datefield,'M/DD/YYYY'),Date#(datefield,'YYYYMMDD'),'MM/DD/YYYY' )) As newdate
Hope this helps.