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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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.

Labels (1)
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