Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

String.txt into a DATE

Good Day,

     I have TXT.FILES naming

     TESTJUNE2012.TXT

     TESTAUGUST.TXT

     TESTJULY 2012.TXT

    anyone can give me a example how do i convert it into a DATE?

THANKS.

1 Reply
prieper
Master II
Master II

You may work with kind of mapping table:

[code]map_Dates: MAPPING LOAD * INLINE [FileName, Date

JANUARY, 1/1/2012

FEBRUARY,1/2/2012

MARCH, 1/3/2012

...];

LOAD

     *,

     APPLYMAP('mapDates', TRIM(REPLACE(REPLACE(REPLACE(FILENAME(), 'TEST', ''), '.TXT', ''), '2012', ''))     AS Date

FROM

     ...;

[/code]

HTH
Peter