<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extract date from string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205678#M62060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When loading data from an Excel file I'm trying to get the date (yyyymmdd) information from a column with different file names inte a separete field. The problem is that the file name doesn't have the same formate all the time and there could also be spelling errors or missing date information. I have the following exampel data from a column:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_20090916_MB_Trp_011.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VDR_TokyoXB30_20100917_072.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;200900903-160735-sea-sea-xb30-ji-as-001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;XAM151_20090827_Tp_027.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_TRP_20070901_CB_013.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_test_20090831_CB_001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;20090827-180259-sfo-sfo-xb30-tm-tf-001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;20090812-174003-msy-msy-xb30-as-cn001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;dph_gfy607_20090724_DA_LDW022.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_20080331_DFB725_WT_004.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_DFB725_30d2_em2_AK_200.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;#3 have a spelling error in the file name&lt;BR /&gt;#11 have no date information&lt;/P&gt;&lt;P&gt;Both #3 and #11 should be handeld as if date is unkown.&lt;/P&gt;&lt;P&gt;I've tried with wildmatch(), index(), mid() and subfield() and i guess they should be used with a for loop (or IF), but I can't get it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Oct 2009 16:26:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-02T16:26:23Z</dc:date>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205678#M62060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When loading data from an Excel file I'm trying to get the date (yyyymmdd) information from a column with different file names inte a separete field. The problem is that the file name doesn't have the same formate all the time and there could also be spelling errors or missing date information. I have the following exampel data from a column:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_20090916_MB_Trp_011.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VDR_TokyoXB30_20100917_072.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;200900903-160735-sea-sea-xb30-ji-as-001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;XAM151_20090827_Tp_027.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_TRP_20070901_CB_013.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_KHT350_test_20090831_CB_001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;20090827-180259-sfo-sfo-xb30-tm-tf-001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;20090812-174003-msy-msy-xb30-as-cn001.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;dph_gfy607_20090724_DA_LDW022.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_20080331_DFB725_WT_004.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV style="margin: 0cm 0cm 0pt;"&gt;VCI_DFB725_30d2_em2_AK_200.dvl&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;#3 have a spelling error in the file name&lt;BR /&gt;#11 have no date information&lt;/P&gt;&lt;P&gt;Both #3 and #11 should be handeld as if date is unkown.&lt;/P&gt;&lt;P&gt;I've tried with wildmatch(), index(), mid() and subfield() and i guess they should be used with a for loop (or IF), but I can't get it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 16:26:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205678#M62060</guid>
      <dc:creator />
      <dc:date>2009-10-02T16:26:23Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205679#M62061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The appropriate tool for this is a Regular Expression, but as far as I know they are not supported by QlikView. But you could write a VBScript function in the module using RegExp Object and use it in the script. That's what I would do.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 16:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205679#M62061</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-02T16:45:56Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205680#M62062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just by analyzing the example you posted of your information, this worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;test:&lt;BR /&gt;load&lt;BR /&gt;makedate(left(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),4),mid(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),5,2),right(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),2)) as Date,&lt;BR /&gt;left(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),4) as Year,&lt;BR /&gt;mid(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),5,2) as Month,&lt;BR /&gt;right(if(index(value,'20')&amp;gt;0 and (mid(value,index(value,'20')+8,1)='-' or mid(value,index(value,'20')+8,1)='_'),mid(value,index(value,'20'),8)),2) as Day&lt;BR /&gt;inline [&lt;BR /&gt;value&lt;BR /&gt;VCI_KHT350_20090916_MB_Trp_011.dvl&lt;BR /&gt;VDR_TokyoXB30_20100917_072.dvl&lt;BR /&gt;20090903-160735-sea-sea-xb30-ji-as-001.dvl&lt;BR /&gt;XAM151_20090827_Tp_027.dvl&lt;BR /&gt;VCI_KHT350_TRP_20070901_CB_013.dvl&lt;BR /&gt;VCI_KHT350_test_20090831_CB_001.dvl&lt;BR /&gt;20090827-180259-sfo-sfo-xb30-tm-tf-001.dvl&lt;BR /&gt;20090812-174003-msy-msy-xb30-as-cn001.dvl&lt;BR /&gt;dph_gfy607_20090724_DA_LDW022.dvl&lt;BR /&gt;VCI_20080331_DFB725_WT_004.dvl&lt;BR /&gt;VCI_DFB725_30d2_em2_AK_200.dvl&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could add more checks to make sure the loaded date is in reality a date, as I only check for '20' and a "_" or a "-" 8 chars later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 22:25:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205680#M62062</guid>
      <dc:creator />
      <dc:date>2009-10-02T22:25:58Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205681#M62063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to demonstrate the power of regular expressions see enclosed my sample. You can add filenames in whatever shape you like as long as there is a date in the format YYYYMMDD included (beginning with year 20.., but you can modify the Regular Expression used)&lt;/P&gt;&lt;P&gt;QlikView should really add RegEx support to it's features .... I'll launch a feature request the next days.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 23:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205681#M62063</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-02T23:22:12Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205682#M62064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, regular expression support seems like a pretty basic feature. Hopefully it will get added at some point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2009 23:29:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205682#M62064</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-10-02T23:29:40Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205683#M62065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0cm 0cm 0pt;"&gt;I worked, thank you. But I will definitely recommend my customer to do changes in the database and add more fields where date and other information from the string are divided into separate fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 14:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205683#M62065</guid>
      <dc:creator />
      <dc:date>2009-10-05T14:22:12Z</dc:date>
    </item>
    <item>
      <title>Extract date from string</title>
      <link>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205684#M62066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its really slow &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; anyone got a fast one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2010 17:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extract-date-from-string/m-p/205684#M62066</guid>
      <dc:creator>amien</dc:creator>
      <dc:date>2010-02-16T17:47:20Z</dc:date>
    </item>
  </channel>
</rss>

