<?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 postcode validation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218097#M71267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm looking for a way of validating a postcode in load script.&lt;/P&gt;&lt;P&gt;i found this on the cabinet office data standards catalogue: (&lt;A href="http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx"&gt;http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx&lt;/A&gt;)&lt;/P&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:simpleType name="PostCodeType"&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:annotation&amp;gt; &lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:documentation&amp;gt;complex pattern for postcode, which matches definition, accepted by some parsers is: "(GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})"&amp;lt;/xsd:documentation&amp;gt;&lt;/DIV&gt;&amp;lt;/xsd:annotation&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:restriction base="xsd:string"&amp;gt; &lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:pattern value="[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z-[CIKMOV]]{2}"/&amp;gt;&lt;/DIV&gt;&amp;lt;/xsd:restriction&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;/xsd:simpleType&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;was just wondering if anyone had any suggestions for this?&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;Cheers&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;Rick&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jul 2010 16:19:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-07-08T16:19:20Z</dc:date>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218097#M71267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm looking for a way of validating a postcode in load script.&lt;/P&gt;&lt;P&gt;i found this on the cabinet office data standards catalogue: (&lt;A href="http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx"&gt;http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx&lt;/A&gt;)&lt;/P&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:simpleType name="PostCodeType"&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:annotation&amp;gt; &lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:documentation&amp;gt;complex pattern for postcode, which matches definition, accepted by some parsers is: "(GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})"&amp;lt;/xsd:documentation&amp;gt;&lt;/DIV&gt;&amp;lt;/xsd:annotation&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:restriction base="xsd:string"&amp;gt; &lt;DIV style="margin-left: 1em;"&gt;&amp;lt;xsd:pattern value="[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z-[CIKMOV]]{2}"/&amp;gt;&lt;/DIV&gt;&amp;lt;/xsd:restriction&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&amp;lt;/xsd:simpleType&amp;gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;was just wondering if anyone had any suggestions for this?&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;Cheers&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 1em;"&gt;Rick&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 16:19:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218097#M71267</guid>
      <dc:creator />
      <dc:date>2010-07-08T16:19:20Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218098#M71268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a regular expression for a postcode validation in UK. This one is more detailed and accurate:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This one is simpler:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z-[CIKMOV]]{2}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;There is no internal function in QV for regular expressions. You can use VBScript macros or use a database function at dataload time in QV script.&lt;/P&gt;&lt;P&gt;Remember in other countries there are other rules for post/zip codes. &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 16:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218098#M71268</guid>
      <dc:creator />
      <dc:date>2010-07-08T16:36:25Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218099#M71269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple possible solutions in this thread, though it looks like the definition of a post code is a little different than I was told over there. Hopefully it can be modified to suit. The idea is brute force, just specifying the allowed characters for each position.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/forums/t/30223.aspx"&gt;http://community.qlik.com/forums/t/30223.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;John Witherspoon wrote: I'm honestly not thinking of a better way than pure brute force:&lt;BR 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;BR /&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;BR 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;BR 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;BR /&gt;It won't surprise me if there's a clever way to do it. I'm just not thinking of one.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 20:55:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218099#M71269</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-07-08T20:55:09Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218100#M71270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that in UK they don't have a fixed format for postcodes. Here are some examples:&lt;BR /&gt;RG4 5EB&lt;BR /&gt;W1 1EV&lt;BR /&gt;SW1A 1AA&lt;/P&gt;&lt;P&gt;It looks like car plate numbers in US. But car plate numbers in UK have more strict format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 21:17:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218100#M71270</guid>
      <dc:creator />
      <dc:date>2010-07-08T21:17:19Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218101#M71271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Nick Bor wrote:There is no internal function in QV for regular expressions. You can use VBScript macros&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The QV Cookbook has a sampled named "Regular Expression pattern matching function" that shows how to use RegEx to validate US Phone numbers. Similar exercise if you want to use that as a starting point.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 23:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218101#M71271</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-07-08T23:29:52Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218102#M71272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Rob Wunderlich wrote:The QV Cookbook has a sampled named "Regular Expression pattern matching function"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Where can I find it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jul 2010 01:05:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218102#M71272</guid>
      <dc:creator />
      <dc:date>2010-07-09T01:05:42Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218103#M71273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can download the Cookbook from&lt;/P&gt;&lt;P&gt;&lt;A href="http://robwunderlich.com/Download.html"&gt;http://robwunderlich.com/Download.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jul 2010 22:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218103#M71273</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-07-09T22:31:50Z</dc:date>
    </item>
    <item>
      <title>postcode validation</title>
      <link>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218104#M71274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks guys used a combination of all the answers given,&lt;/P&gt;&lt;P&gt;used the first regex suggested but couldnt get the hang of the syntax so used the Cookbook to help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 09:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/postcode-validation/m-p/218104#M71274</guid>
      <dc:creator />
      <dc:date>2010-07-14T09:35:49Z</dc:date>
    </item>
  </channel>
</rss>

