<?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 How to add leading zero's and make sure all the values have equal number of digits? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218693#M71775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Thanx for the extra answer. Both yours and Rainers solution work for me, but always good to know several ways to do it!&lt;/P&gt;&lt;P&gt;Gjalt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Dec 2010 14:19:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-12-09T14:19:17Z</dc:date>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218687#M71769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm seeing all kinds of posts on how to remove leading zero's but I'm looking for a way to &lt;B&gt;add&lt;/B&gt; leading zero's.&lt;/P&gt;&lt;P&gt;I've got a field with entries that have 6 or 7 digits. I need them all to have 7 digits and add a leading zero to the ones that have 6 digits&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;123456&lt;/P&gt;&lt;P&gt;1234567&lt;/P&gt;&lt;P&gt;Need to be transferred into&lt;/P&gt;&lt;P&gt;0123456&lt;/P&gt;&lt;P&gt;1234567&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using the format command &lt;I&gt;num(value,'#######')&lt;/I&gt; but that doesn't do the trick. I'm guessing it should also be something with &lt;I&gt;text(value),&lt;/I&gt; but how to add that extra zero?&lt;/P&gt;&lt;P&gt;My table has about 4 mln records, so I guess I have to look for a fairly straightforward solution to keep it operateable...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx!&lt;/P&gt;&lt;P&gt;Gjalt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 11:59:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218687#M71769</guid>
      <dc:creator />
      <dc:date>2010-12-09T11:59:07Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218688#M71770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gjalt,&lt;/P&gt;&lt;P&gt;If those values don't have the leading zero in your data source, then you can add them doing something like the following in your load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;If(Field &amp;lt; 1000000, '0' &amp;amp; Field, Field) AS FieldWithZeroes,&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That should work. Anyway, you can use the Text() function to make sure you are representing those values as strings, and not as numeric values (where 1234 is equal to 00001234)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Text(If(Field &amp;lt; 1000000, '0' &amp;amp; Field, Field)) AS FieldWithZeroes,&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 12:42:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218688#M71770</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-12-09T12:42:24Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218689#M71771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gjalt,&lt;/P&gt;&lt;P&gt;there are even more then one solution. The easiest in my opinion is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;IF (LEN(Inputfield) = 6, '0' &amp;amp; Inpufield, Inputfield) AS InputField;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Being more flexible: LEFT('0000000000', 10 - LEN(Inputfield)) &amp;amp; Inputfield&lt;/P&gt;&lt;P&gt;Regards, Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 12:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218689#M71771</guid>
      <dc:creator />
      <dc:date>2010-12-09T12:52:38Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218690#M71772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gjalt,&lt;/P&gt;&lt;P&gt;you are very near to a solution.&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;NUM(YourField,'0000000') as LeadingZeros&lt;/P&gt;&lt;P&gt;That´s all.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 13:00:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218690#M71772</guid>
      <dc:creator />
      <dc:date>2010-12-09T13:00:50Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218691#M71773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick answers guys. The one by Rainer worked excellent and seems the easiest.&lt;/P&gt;&lt;P&gt;so close....!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 13:06:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218691#M71773</guid>
      <dc:creator />
      <dc:date>2010-12-09T13:06:57Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218692#M71774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on what Roland suggests, and regardless the number of digits the code may have, the following will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Repeat('0', 10 - Len(Field)) &amp;amp; Field AS Field,&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This way you don't have to take care on how many digits the actual value has. I've set 10 as maximum number of digits a value can have.&lt;/P&gt;&lt;P&gt;I'd use something like this instead of the Num() formatting since it's still a number, and depending on your datamodel and the charts you want to draw, num 01234 and num 1234 will be the same, although they are not.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 13:10:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218692#M71774</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-12-09T13:10:44Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218693#M71775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Thanx for the extra answer. Both yours and Rainers solution work for me, but always good to know several ways to do it!&lt;/P&gt;&lt;P&gt;Gjalt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 14:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218693#M71775</guid>
      <dc:creator />
      <dc:date>2010-12-09T14:19:17Z</dc:date>
    </item>
    <item>
      <title>How to add leading zero's and make sure all the values have equal number of digits?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218694#M71776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;num(value,'0000000')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suerte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 17:21:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-add-leading-zero-s-and-make-sure-all-the-values-have/m-p/218694#M71776</guid>
      <dc:creator />
      <dc:date>2010-12-09T17:21:37Z</dc:date>
    </item>
  </channel>
</rss>

