<?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: Extracting states from an address field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667896#M242863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use the mid&amp;nbsp; function.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I have the date like 01-Feb-2014&lt;/P&gt;&lt;P&gt;now my requirement is to get only Feb as output for that I'll written the condition like&lt;/P&gt;&lt;P&gt;Mid(Date,3,3) -&amp;gt; O/p is Feb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jun 2014 11:40:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-12T11:40:00Z</dc:date>
    <item>
      <title>Extracting states from an address field</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667894#M242861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an address field and in order to categorise the states into a region, I need to extract the specific 3 digit state code.&lt;/P&gt;&lt;P&gt;addresses are pretty standard i.e. &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, san-serif;"&gt;P. Sherman 42 Wallaby Way, Sydney, NSW, 2000 and I am looking to get the state code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm and Aussie so we only have the following state and territory codes required.&lt;/P&gt;&lt;P&gt;ACT, NSW, QLD, TAS, WA, SA, NT, VIC&lt;/P&gt;&lt;P&gt;The problem is that none of the addresses have a standard delimiter, nor position within the data for the state code and some of them are missing altogether (I would use an NA result for those if possible)&lt;/P&gt;&lt;P&gt;Can you please have a think and let me know if this is possible? I am investigating substring functions and will post an answer if I can come up with one!&lt;/P&gt;&lt;P&gt;Oh and this needs to be in the script so I can use an applymap function to categorise them &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 11:07:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667894#M242861</guid>
      <dc:creator />
      <dc:date>2014-06-12T11:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting states from an address field</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667895#M242862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;StateMap:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StateCode, State&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 0,NA &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, ACT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, NSW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, QLD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, TAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, WA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, SA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, NT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8, VIC&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *, ApplyMap('StateMap',Statecode) as State;&lt;/P&gt;&lt;P&gt;Load Address,WildMatch(Address,'*ACT*', '*NSW*', '*QLD*', '*TAS*', '*WA*', '*SA*', '*NT*', '*VIC*') as Statecode;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "P. Sherman 42 Wallaby Way, Sydney, NSW, 2000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "P. Sherman 42 Wallaby Way, Sydney, QLD, 2000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "P. Sherman 42 Wallaby Way, Sydney TAS 2000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "WA 3000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "XXXX YYYYY"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 11:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667895#M242862</guid>
      <dc:creator />
      <dc:date>2014-06-12T11:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting states from an address field</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667896#M242863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use the mid&amp;nbsp; function.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I have the date like 01-Feb-2014&lt;/P&gt;&lt;P&gt;now my requirement is to get only Feb as output for that I'll written the condition like&lt;/P&gt;&lt;P&gt;Mid(Date,3,3) -&amp;gt; O/p is Feb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 11:40:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667896#M242863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-12T11:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting states from an address field</title>
      <link>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667897#M242864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou Uday!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will apply this to my model &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greatly appreciated!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 11:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Extracting-states-from-an-address-field/m-p/667897#M242864</guid>
      <dc:creator />
      <dc:date>2014-06-12T11:57:57Z</dc:date>
    </item>
  </channel>
</rss>

