<?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 Applymap using wildcard for UK postcodes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764119#M454176</link>
    <description>&lt;P&gt;Hi - I have a dataset which contains UK postcodes in following format:&lt;BR /&gt;&lt;BR /&gt;BH21 3PL - Out of Area&lt;BR /&gt;BH30 2PH - Out of Area&lt;BR /&gt;BH1 1FG - Out of Area&lt;BR /&gt;SO16 6TF - In Area&lt;BR /&gt;SO21 4RT - In Area&lt;BR /&gt;SO1 4RE - In Area&lt;BR /&gt;SP10 3ES - Out of Area&lt;BR /&gt;SP4 2WQ - Out of Area&lt;BR /&gt;SP7 5PK - Out of Area&lt;BR /&gt;PO4 5TF - Portsmouth&lt;BR /&gt;PO21 3WD - Portsmouth&lt;BR /&gt;PO22 4TR - Portsmouth&lt;BR /&gt;&lt;BR /&gt;I only really need the first section of the postcode which is either 2 letters and 1 number, or 2 letters and 2 numbers.&amp;nbsp; Once I have this postcode in this format I can then apply some 'applymap' and allocate a map as above.&amp;nbsp; There are obviously many more postcodes and areas mappings but I wanted to just give you a few examples to see what I'm referring to.&lt;/P&gt;&lt;P&gt;So, I want to somehow convert the long postcode format, as above to just two letters and one or two numbers, thus:&lt;/P&gt;&lt;P&gt;BH21 - Out of Area&lt;BR /&gt;BH30 - Out of Area&lt;BR /&gt;BH1 - Out of Area&lt;BR /&gt;SO16 - In Area&lt;BR /&gt;SO21 - In Area&lt;BR /&gt;SO1 - In Area&lt;BR /&gt;SP10 - Out of Area&lt;BR /&gt;SP4 - Out of Area&lt;BR /&gt;SP7 - Out of Area&lt;BR /&gt;PO4 - Portsmouth&lt;BR /&gt;PO21 - Portsmouth&lt;/P&gt;&lt;P&gt;Appreciate your help guys.&amp;nbsp; Would like to somehow display this as a list box to select:&lt;BR /&gt;&lt;BR /&gt;Out of Area&lt;BR /&gt;In Area&lt;BR /&gt;Portsmouth&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 17:46:57 GMT</pubDate>
    <dc:creator>jlampard40</dc:creator>
    <dc:date>2024-11-16T17:46:57Z</dc:date>
    <item>
      <title>Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764119#M454176</link>
      <description>&lt;P&gt;Hi - I have a dataset which contains UK postcodes in following format:&lt;BR /&gt;&lt;BR /&gt;BH21 3PL - Out of Area&lt;BR /&gt;BH30 2PH - Out of Area&lt;BR /&gt;BH1 1FG - Out of Area&lt;BR /&gt;SO16 6TF - In Area&lt;BR /&gt;SO21 4RT - In Area&lt;BR /&gt;SO1 4RE - In Area&lt;BR /&gt;SP10 3ES - Out of Area&lt;BR /&gt;SP4 2WQ - Out of Area&lt;BR /&gt;SP7 5PK - Out of Area&lt;BR /&gt;PO4 5TF - Portsmouth&lt;BR /&gt;PO21 3WD - Portsmouth&lt;BR /&gt;PO22 4TR - Portsmouth&lt;BR /&gt;&lt;BR /&gt;I only really need the first section of the postcode which is either 2 letters and 1 number, or 2 letters and 2 numbers.&amp;nbsp; Once I have this postcode in this format I can then apply some 'applymap' and allocate a map as above.&amp;nbsp; There are obviously many more postcodes and areas mappings but I wanted to just give you a few examples to see what I'm referring to.&lt;/P&gt;&lt;P&gt;So, I want to somehow convert the long postcode format, as above to just two letters and one or two numbers, thus:&lt;/P&gt;&lt;P&gt;BH21 - Out of Area&lt;BR /&gt;BH30 - Out of Area&lt;BR /&gt;BH1 - Out of Area&lt;BR /&gt;SO16 - In Area&lt;BR /&gt;SO21 - In Area&lt;BR /&gt;SO1 - In Area&lt;BR /&gt;SP10 - Out of Area&lt;BR /&gt;SP4 - Out of Area&lt;BR /&gt;SP7 - Out of Area&lt;BR /&gt;PO4 - Portsmouth&lt;BR /&gt;PO21 - Portsmouth&lt;/P&gt;&lt;P&gt;Appreciate your help guys.&amp;nbsp; Would like to somehow display this as a list box to select:&lt;BR /&gt;&lt;BR /&gt;Out of Area&lt;BR /&gt;In Area&lt;BR /&gt;Portsmouth&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764119#M454176</guid>
      <dc:creator>jlampard40</dc:creator>
      <dc:date>2024-11-16T17:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764252#M454182</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/23929"&gt;@jlampard40&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;Load *, SubField(PostalCodeWithArea,' ',1) as PostalCode,&lt;BR /&gt;Trim(SubField(PostalCodeWithArea, '-',-1))as Area,&lt;BR /&gt;SubField(PostalCodeWithArea,' ',1)&amp;amp;' - '&amp;amp;Trim(SubField(PostalCodeWithArea, '-',-1)) as ShortArea inline&lt;BR /&gt;[&lt;BR /&gt;PostalCodeWithArea&lt;BR /&gt;BH21 3PL - Out of Area&lt;BR /&gt;BH30 2PH - Out of Area&lt;BR /&gt;BH1 1FG - Out of Area&lt;BR /&gt;SO16 6TF - In Area&lt;BR /&gt;SO21 4RT - In Area&lt;BR /&gt;SO1 4RE - In Area&lt;BR /&gt;SP10 3ES - Out of Area&lt;BR /&gt;SP4 2WQ - Out of Area&lt;BR /&gt;SP7 5PK - Out of Area&lt;BR /&gt;PO4 5TF - Portsmouth&lt;BR /&gt;PO21 3WD - Portsmouth&lt;BR /&gt;PO22 4TR - Portsmouth&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MayilVahanan_0-1606292610813.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/44778iCE1461C347FB7CE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MayilVahanan_0-1606292610813.png" alt="MayilVahanan_0-1606292610813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can replace the inline with ur data source.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 08:23:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764252#M454182</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-25T08:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764287#M454184</link>
      <description>&lt;P&gt;Hi MayilVahanan - the only problem I have is a huge dataset with over 1.7 million different postcodes in format AA99 AAA or AA9 AAA (where A can be any letter combo specific to an area and 9 represents the number element of the postcode from 1 to 99).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't change the original data as it's stuck in the format as above.&amp;nbsp; Ideally what I'd like is to be able to, somehow, read the postcode data and then clip it to JUST show the first part of it i.e. the AA99 or AA9 part of it.&amp;nbsp; The other part I don't really need as it's just the general area I need to be able to define as 'In area' or 'Out of Area' for my data visualisation.&lt;/P&gt;&lt;P&gt;So how can I load all this data into Qlikview, tell Qlikview to trim / clip the first part and then allow me to use in a list box as 'In Area' or 'Out of Area'.&amp;nbsp; This is a tricky one as there are so many lines of data, I need Qlikview to do trim / clip it automatically during load, then give me a dimension / field to use in a list box for 'In Area' or 'Out of Area'.&amp;nbsp; Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 09:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764287#M454184</guid>
      <dc:creator>jlampard40</dc:creator>
      <dc:date>2020-11-25T09:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764300#M454187</link>
      <description>&lt;P&gt;Yes - we have Excel 2010 though (!) and the data is run on a daily basis as it's always a 'snapshot' of that day, so cannot trawl through the thousands of datasets and format the postcode through Excel.&amp;nbsp; I really need to find a way through Qlikview to give me the first part of the postcode, during load, then allow me to define 'in' or 'out' of area depending on this first part of the postcode, in a list box.&amp;nbsp; Hopefully someone on here can help me as I've reached a complete dead end here guys.&amp;nbsp; Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 10:35:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764300#M454187</guid>
      <dc:creator>jlampard40</dc:creator>
      <dc:date>2020-11-25T10:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764307#M454188</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/23929"&gt;@jlampard40&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As mentioned earlier, you can replace with inline table to ur data source. You can use the logic.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Load *, &lt;STRONG&gt;SubField(PostalCodeWithArea,' ',1) as PostalCode,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Trim(SubField(PostalCodeWithArea, '-',-1))as Area,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SubField(PostalCodeWithArea,' ',1)&amp;amp;' - '&amp;amp;Trim(SubField(PostalCodeWithArea, '-',-1)) as ShortArea&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 10:49:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764307#M454188</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-25T10:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764329#M454189</link>
      <description>&lt;P&gt;MAyilVahanan - that's great.&amp;nbsp; Qlikview now presents the postcode as first part, but how can I then now apply mapping to this to say, if postcodes are, say, SO1 to SO16 it is 'In Area' and if it's say PO1 to PO20 it's defined as Portsmouth and all other postcodes are 'Out of Area'?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help thus far MayilVahanan.&amp;nbsp; Rgds&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 11:53:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764329#M454189</guid>
      <dc:creator>jlampard40</dc:creator>
      <dc:date>2020-11-25T11:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap using wildcard for UK postcodes</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764433#M454196</link>
      <description>&lt;P&gt;What if I try a different technique and create a map in the usual way, the use this statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;applymap(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;'mytable', left(FIELD,4) )&lt;BR /&gt;&lt;BR /&gt;My problem, however, is that some of the postcodes only have 3 digits in the first part, so will potentially be missed out?&amp;nbsp; Is there any way of asking Qlikview to left trim EITHER 3 or 4 digits, depending on whether the postcode is in format AA9 AAA or AA99 AAA?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:23:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-using-wildcard-for-UK-postcodes/m-p/1764433#M454196</guid>
      <dc:creator>jlampard40</dc:creator>
      <dc:date>2020-11-25T15:23:33Z</dc:date>
    </item>
  </channel>
</rss>

