<?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 Validating Data in a load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184570#M49411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to write a load script that only loads data from a field where it is in the correct format - 'XX## #XX' i.e. UK postcode. I have introduced a validation rule using the LEN function but how would I go about ensuring all match the exact format?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jun 2010 15:49:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-10T15:49:44Z</dc:date>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184570#M49411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to write a load script that only loads data from a field where it is in the correct format - 'XX## #XX' i.e. UK postcode. I have introduced a validation rule using the LEN function but how would I go about ensuring all match the exact format?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 15:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184570#M49411</guid>
      <dc:creator />
      <dc:date>2010-06-10T15:49:44Z</dc:date>
    </item>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184571#M49412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there is a function that validates format pattern... You might have to parse the string and validate each part separately... Search the Help Text for "String Functions" - there are quite many, and they are all described in one article.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 16:04:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184571#M49412</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-06-10T16:04:17Z</dc:date>
    </item>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184572#M49413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for letting me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 16:08:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184572#M49413</guid>
      <dc:creator />
      <dc:date>2010-06-10T16:08:25Z</dc:date>
    </item>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184573#M49414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just thinking this one through, even if I parsed the string (e.g. left(postcode, 2)) how would I validate the part?&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 16:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184573#M49414</guid>
      <dc:creator />
      <dc:date>2010-06-10T16:18:22Z</dc:date>
    </item>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184574#M49415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's why I mentioned String functions - there is a variety of ways to compare strings and substrings and ensure that vertain part is noly numeric, and certain part is only characters - Index, Match, FindOneOf, and more... You just need to formulate your conditions properly. Worst case - you might have to validate each one of the 8 characters, if it's so important...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 18:13:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184574#M49415</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-06-10T18:13:26Z</dc:date>
    </item>
    <item>
      <title>Validating Data in a load script</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184575#M49416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm honestly not thinking of a better way than pure brute force:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if( index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',mid(postcode,1,1))&lt;BR /&gt; and index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',mid(postcode,2,1))&lt;BR /&gt; and index('0123456789' ,mid(postcode,3,1))&lt;BR /&gt; and index('0123456789' ,mid(postcode,4,1))&lt;BR /&gt; and mid(postcode,5,1) = ' '&lt;BR /&gt; and index('0123456789' ,mid(postcode,6,1))&lt;BR /&gt; and index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',mid(postcode,7,1))&lt;BR /&gt; and index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',mid(postcode,8,1)),postcode,'Error') as postcode&lt;/P&gt;&lt;P&gt;I mean, we could create fake functions, but I don't think it's worth the complexity. I think it would look something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET alpha = index('ABCDEFGHIJKLMNOPQRSTUVWXYZ',mid($1,$2,1));&lt;BR /&gt;SET digit = index('0123456789',mid($1,$2,1));&lt;BR /&gt;SET space = mid($1,$2,1) = ' ';&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if( $(alpha(postcode,1))&lt;BR /&gt; and $(alpha(postcode,2))&lt;BR /&gt; and $(digit(postcode,3))&lt;BR /&gt; and $(digit(postcode,4))&lt;BR /&gt; and $(space(postcode,5))&lt;BR /&gt; and $(digit(postcode,6))&lt;BR /&gt; and $(alpha(postcode,7))&lt;BR /&gt; and $(alpha(postcode,8)),postcode,'Error') as postcode&lt;/P&gt;&lt;P&gt;It won't surprise me if there's a clever way to do it. I'm just not thinking of one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jun 2010 00:52:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-Data-in-a-load-script/m-p/184575#M49416</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-06-12T00:52:30Z</dc:date>
    </item>
  </channel>
</rss>

