<?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: Zip Code Formats in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1642661#M731232</link>
    <description>&lt;P&gt;Arthur - Here's an additional question that stems from a deeper review of the data.&amp;nbsp; &amp;nbsp;This function worked, but I found a situation where the Zip field had 8 digits, where there should have been 9, which means that the leading 0 has been dropped.&lt;/P&gt;&lt;P&gt;Can I insert additional conditions into what you sent to account for this?&lt;/P&gt;&lt;P&gt;my Zip field is reading:&amp;nbsp; &amp;nbsp;77510000&lt;/P&gt;&lt;P&gt;when I use the function you provided I get:&amp;nbsp; &amp;nbsp;77510, which is correct based on your programming but not correct based on what the value should be.&lt;/P&gt;&lt;P&gt;I should get:&amp;nbsp; &amp;nbsp;07751&lt;/P&gt;&lt;P&gt;So hence my question of adding additional conditions.&lt;/P&gt;&lt;P&gt;I've used this function in my LOAD statement.&amp;nbsp; My data loads from QVD's.&amp;nbsp; While the script runs all the way through the results in my field are either 0 or -1.&lt;/P&gt;&lt;P&gt;if(len(EMPE_ZIP_CD)&amp;lt;5,num(EMPE_ZIP_CD, '00000'),if(len(EMPE_ZIP_CD)&amp;gt;5,left(EMPE_ZIP_CD,5), EMPE_ZIP_CD)) or&lt;BR /&gt;if(len(EMPE_ZIP_CD)=8,left(num#(EMPE_ZIP_CD,'00000'),4), EMPE_ZIP_CD) as EE_Zip&lt;/P&gt;&lt;P&gt;Would really appreciate any additional help.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 19:27:49 GMT</pubDate>
    <dc:creator>gfisch13</dc:creator>
    <dc:date>2019-11-05T19:27:49Z</dc:date>
    <item>
      <title>Zip Code Formats</title>
      <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1641853#M731229</link>
      <description>&lt;P&gt;Hi everyone -&lt;/P&gt;&lt;P&gt;I have a Zip Code field in my data that has inconsistent data.&amp;nbsp; I need to parse several formats but I'm not sure how to go about it.&lt;/P&gt;&lt;P&gt;the field is a 9 character text field, my formats look like the following:&lt;/P&gt;&lt;P&gt;12345&lt;/P&gt;&lt;P&gt;123450000&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12345&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7751&amp;nbsp; &amp;nbsp; (this one drops a leading zero, its 07751 in NJ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thinking I need some type of conditional, but I'm not sure of the functions to use, nor do I understand how to place this in the load script.&amp;nbsp; &amp;nbsp;My goal is to end up with just the 5 digits of the zip code.&lt;/P&gt;&lt;P&gt;Any input is appreciated - thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:46:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1641853#M731229</guid>
      <dc:creator>gfisch13</dc:creator>
      <dc:date>2024-11-16T19:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Code Formats</title>
      <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1641930#M731230</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Raw:&lt;BR /&gt;load if(len(PostCode)&amp;lt;5,num(PostCode,'00000'),if(len(PostCode)&amp;gt;5,left(PostCode,5),PostCode))as PostCode inline [&lt;BR /&gt;PostCode&lt;BR /&gt;123450000&lt;BR /&gt;34567&lt;BR /&gt;7751&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 23:45:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1641930#M731230</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-10-31T23:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Code Formats</title>
      <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1642136#M731231</link>
      <description>&lt;P&gt;This worked perfectly - thanks Arthur!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 15:20:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1642136#M731231</guid>
      <dc:creator>gfisch13</dc:creator>
      <dc:date>2019-11-01T15:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Code Formats</title>
      <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1642661#M731232</link>
      <description>&lt;P&gt;Arthur - Here's an additional question that stems from a deeper review of the data.&amp;nbsp; &amp;nbsp;This function worked, but I found a situation where the Zip field had 8 digits, where there should have been 9, which means that the leading 0 has been dropped.&lt;/P&gt;&lt;P&gt;Can I insert additional conditions into what you sent to account for this?&lt;/P&gt;&lt;P&gt;my Zip field is reading:&amp;nbsp; &amp;nbsp;77510000&lt;/P&gt;&lt;P&gt;when I use the function you provided I get:&amp;nbsp; &amp;nbsp;77510, which is correct based on your programming but not correct based on what the value should be.&lt;/P&gt;&lt;P&gt;I should get:&amp;nbsp; &amp;nbsp;07751&lt;/P&gt;&lt;P&gt;So hence my question of adding additional conditions.&lt;/P&gt;&lt;P&gt;I've used this function in my LOAD statement.&amp;nbsp; My data loads from QVD's.&amp;nbsp; While the script runs all the way through the results in my field are either 0 or -1.&lt;/P&gt;&lt;P&gt;if(len(EMPE_ZIP_CD)&amp;lt;5,num(EMPE_ZIP_CD, '00000'),if(len(EMPE_ZIP_CD)&amp;gt;5,left(EMPE_ZIP_CD,5), EMPE_ZIP_CD)) or&lt;BR /&gt;if(len(EMPE_ZIP_CD)=8,left(num#(EMPE_ZIP_CD,'00000'),4), EMPE_ZIP_CD) as EE_Zip&lt;/P&gt;&lt;P&gt;Would really appreciate any additional help.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1642661#M731232</guid>
      <dc:creator>gfisch13</dc:creator>
      <dc:date>2019-11-05T19:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Code Formats</title>
      <link>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1643454#M731234</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Raw:&lt;BR /&gt;load&lt;BR /&gt;if(len(PostCode)&amp;lt;5,num(PostCode,'00000'),&lt;BR /&gt;if(len(PostCode)&amp;gt;5 and len(PostCode)&amp;lt;&amp;gt;8,left(PostCode,5),&lt;BR /&gt;if(len(PostCode)&amp;gt;5 and len(PostCode)=8,left(num(PostCode,'000000000'),5),&lt;BR /&gt;PostCode)))as PostCode&lt;BR /&gt;inline [&lt;BR /&gt;PostCode&lt;BR /&gt;123450000&lt;BR /&gt;34567&lt;BR /&gt;7751&lt;BR /&gt;77510000&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 23:52:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Zip-Code-Formats/m-p/1643454#M731234</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-11-05T23:52:44Z</dc:date>
    </item>
  </channel>
</rss>

