<?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 Re: Sub String a UK Postcode in a script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299092#M110839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left( Postcode, ceil(len(Postcode)/2) ) as PostCodeGeoCodeMatch,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of ceil() function, you might need to use floor() depending on how the "first half" of Postcodes in the geocode table is determined when the number of characters is uneven.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could try using one of the match functions or a mapsubstring together with a lookup table (try using a lookup table with two times the geocode's postcodes field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Dec 2011 12:35:40 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-12-14T12:35:40Z</dc:date>
    <item>
      <title>Sub String a UK Postcode in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299091#M110838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a geocodes table that I want to join up to a customer table (which has a UK postcode). My goecode table only contains the first half of theUK postcode (i.e. BB5 or AB24). In my script I need to substring the Postcode field in my customer table. Does someone know how to do this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to bear in mind that I don't always need tyhe first x characters as string I need could be anything from 2 to 4 characters long. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help. &lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 11:53:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299091#M110838</guid>
      <dc:creator>stuwannop</dc:creator>
      <dc:date>2011-12-14T11:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sub String a UK Postcode in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299092#M110839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left( Postcode, ceil(len(Postcode)/2) ) as PostCodeGeoCodeMatch,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of ceil() function, you might need to use floor() depending on how the "first half" of Postcodes in the geocode table is determined when the number of characters is uneven.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could try using one of the match functions or a mapsubstring together with a lookup table (try using a lookup table with two times the geocode's postcodes field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 12:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299092#M110839</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-14T12:35:40Z</dc:date>
    </item>
    <item>
      <title>Sub String a UK Postcode in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299093#M110840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, UK postcodes have a space as delimiter, right? And you need the first part only?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield( Postcode, ' ', 1) as PostCodeGeoCodeMatch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 12:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299093#M110840</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-14T12:39:54Z</dc:date>
    </item>
    <item>
      <title>Sub String a UK Postcode in a script</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299094#M110841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like both the solutions you offered work. I went with the first option &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left( Postcode, ceil(len(Postcode)/2) )) as PostCodeGeoCodeMatch &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now just need to work out google maps! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help much appreciated. &lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 12:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-String-a-UK-Postcode-in-a-script/m-p/299094#M110841</guid>
      <dc:creator>stuwannop</dc:creator>
      <dc:date>2011-12-14T12:44:02Z</dc:date>
    </item>
  </channel>
</rss>

