<?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 Leading zeros in string fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210454#M65036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try load with "_" char in front of the values, to force reading as text, then remove it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Oct 2009 17:23:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-15T17:23:21Z</dc:date>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210449#M65031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application that load data from SQL-Server 2000.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;SQL SELECT Myfield1,&lt;/P&gt;&lt;P&gt;Myfield2&lt;/P&gt;&lt;P&gt;FROM MyTable;&lt;/P&gt;&lt;P&gt;The datatype of the field Myfield2 is VARCHAR(10) and contains information such as 1234 and 0001234. However, Qlikview eliminates the leading zeros during load process.&lt;/P&gt;&lt;P&gt;For example: 0001234 is transformed to 1234.&lt;/P&gt;&lt;P&gt;This situation cause a duplicate data in my application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I keep the original format in the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Edouard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 07:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210449#M65031</guid>
      <dc:creator />
      <dc:date>2009-10-08T07:02:29Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210450#M65032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one:&lt;/P&gt;&lt;P&gt;Load Myfield1,text(Myfield2) as Myfield2;&lt;BR /&gt;SQL Select Myfield1,Myfield2 from MyTable;&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 10:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210450#M65032</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-08T10:09:09Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210451#M65033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Biester,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have already tried this. The problem occurs at the moment we retrieve the data from our SQL 2000 server using an OLEDB Connection. Apparently qlikview assumes that 000123 is the same as 123 and keeps all the data as 123 (sometimes even 000123, apparently it's random). This causes data to be lost, because since the field is of type Varchar 000123 is not the same as 123.&lt;/P&gt;&lt;P&gt;So the problem is on the SQL SELECT Clause, not on the LOAD clause, we tried altering the Connection String to avoid unnecessary fields but it didn't work.&lt;/P&gt;&lt;P&gt;We tried forcing the SQL Statement using the CONVERT(VARCHAR(10), Text1) funciton but it also didn't work.&lt;/P&gt;&lt;P&gt;It's probably a Qlikview related Bug or an option that we either have to set ON or OFF but we can't find any information regarding this issue on qlikview Help or Discussion Boards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 05:52:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210451#M65033</guid>
      <dc:creator />
      <dc:date>2009-10-15T05:52:35Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210452#M65034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably it's not the same, but maybe you get something out of it. To keep leading zeros in zip codes, I'm using formatting:&lt;BR /&gt;&lt;B&gt;num(Zip, '00000') as Zip&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 08:49:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210452#M65034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-15T08:49:49Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210453#M65035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The text() function works for me. I tried the example you provided on SQL2005 like this:&lt;/P&gt;&lt;P&gt;LOAD myInt,&lt;BR /&gt; text(myVar) as myVarT,&lt;BR /&gt; myVar as myVar;&lt;BR /&gt;SQL SELECT myInt,&lt;BR /&gt; myVar&lt;BR /&gt;FROM robtest.dbo.qvtest;&lt;/P&gt;&lt;P&gt;myVarT showed both "1234" and "0001234". I tried QV 8.50.6299 and 9.0.7119.&lt;/P&gt;&lt;P&gt;Can you post your script or even better a sample qvw?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;edouarddgnx wrote:sometimes even 000123, apparently it's random&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;It's not random. When displaying numbers, QV uses the first string representation of the number it loads as the display. See "Dual" in the reference guide.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 09:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210453#M65035</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-10-15T09:44:08Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210454#M65036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try load with "_" char in front of the values, to force reading as text, then remove it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 17:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210454#M65036</guid>
      <dc:creator />
      <dc:date>2009-10-15T17:23:21Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210455#M65037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, This is an easier approach.&lt;/P&gt;&lt;P&gt;--Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 17:35:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210455#M65037</guid>
      <dc:creator />
      <dc:date>2009-10-15T17:35:15Z</dc:date>
    </item>
    <item>
      <title>Leading zeros in string fields</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210456#M65038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Biester,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At a first glance i didn't understand your solution, but when i read it again I understood, I wasn't aware that it was possible to Use a Load Clause in a Select Clause. I made a test application and it worked, we're now altering the original code to check wheter it'll work or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot to everyone that helped and posted solutions, soon i'll right if it worked 100%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 22:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeros-in-string-fields/m-p/210456#M65038</guid>
      <dc:creator />
      <dc:date>2009-10-15T22:59:50Z</dc:date>
    </item>
  </channel>
</rss>

