<?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: QlikView Treating nvarchar2(255) as Numeric in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057077#M354246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also format it with the num() function.&lt;/P&gt;&lt;P&gt;I.e. : &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Num(FieldName,'0000000000') as NumFieldName..&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Jan 2016 15:05:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-01-23T15:05:06Z</dc:date>
    <item>
      <title>QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057075#M354244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;I need some expert answer, in Oracle there is field ZipCode which having data type as nVarChar2(255).&lt;/P&gt;&lt;P&gt;Select statement returns the ZipCode as 012345 but the select statement which creating QVD out of it gives only 12345.&lt;/P&gt;&lt;P&gt;So it removing leading 0, and treating this particular data type as numeric. is there any reason why? is this datatype is not getting interpreted by QlikView as string (any known bug).&lt;/P&gt;&lt;P&gt;I dont want to use casting or anything on query, as all my queries are like&lt;/P&gt;&lt;P&gt;Select *;&lt;/P&gt;&lt;P&gt;Store .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 21:41:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057075#M354244</guid>
      <dc:creator>jaspal_icon</dc:creator>
      <dc:date>2016-01-22T21:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057076#M354245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QlikView was designed to interpret &lt;SPAN style="text-decoration: underline;"&gt;every value&lt;/SPAN&gt; for every column from a flat file or a database as if the value is a number. If it looks like a number - it becomes a number - if it doesn't it will be kept as a text value. So fields in QlikView are actually not enforcing a single data type - it can be mixed. A field can contain both text, numbers, dates, booleans and dual values. Even for relational databases that have columns that are strictly one type QlikView will insist on trying to interpret each and every value. This is explained very thoroughly by &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt; Henric Cronström in this document &lt;A href="https://community.qlik.com/qlik-blogpost/3186"&gt;Automatic Number Interpretation&lt;/A&gt;. It would have been very nice to be able to turn off this overly interpretive behavior with some kind of switch. But that does not exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible to enforce strict text from varchar/text columns in a relational database unless you do something that looks like typecasting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text( ProductCode ) AS ProductCode,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;And it is quite "boring" and tedious to have to wrap every column into this Text() function to disable automatic number interpretation. For larger customer accounts I took the effort of designing a small routine to do this automatically so a SQL table could be read and the LOAD code would be generated automatically with Text() for every non-numeric character column. It is the only way of achieving what you ask for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jan 2016 01:14:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057076#M354245</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-01-23T01:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057077#M354246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also format it with the num() function.&lt;/P&gt;&lt;P&gt;I.e. : &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Num(FieldName,'0000000000') as NumFieldName..&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jan 2016 15:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057077#M354246</guid>
      <dc:creator />
      <dc:date>2016-01-23T15:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057078#M354247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Petter for detailed information. It's going to be tedious not boring if there is no such switch exists.&lt;/P&gt;&lt;P&gt;Earlier we had trailing 0's which was coming due to QlikView 11 initial release version. After that we moved to 11.2 SR5 and SR12 now. Trailing 0's issues resolved by upgrading, but the preceding 0's is nothing to do with any newer release as I think so.&lt;/P&gt;&lt;P&gt;Still if any one from Qlik product team is going to answer this or any hot fix available by chance then it will be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 18:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057078#M354247</guid>
      <dc:creator>jaspal_icon</dc:creator>
      <dc:date>2016-01-26T18:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057079#M354248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guarantee ... there is no such switch. And as I explained the preceding 0's is not a bug it's a known behaviour and feature. &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt;‌ has specifically written about it. If you expect answers from someone at the product team the Community site is probably not the right place to wait for an answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 03:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057079#M354248</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-01-27T03:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057080#M354249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can confirm what Petter says: There is no such switch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could however exist a simple work-around... Try the following: Start by defining all your Zip codes in a temporary table, &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;with the correct format&lt;/EM&gt;&lt;/SPAN&gt;. Then Load your data without changing your code. Your Zip codes should then inherit the defined format automatically, if the same field name is used. Finally, you should delete the temporary table. Hence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tmp:&lt;/P&gt;&lt;P&gt;Load Num(RecNo(),'000000') as Zip Autogenerate 999999;&lt;/P&gt;&lt;P&gt;&amp;lt;Your SELECT statements&amp;gt;&lt;/P&gt;&lt;P&gt;Drop Table Tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 06:46:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057080#M354249</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2016-01-27T06:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Treating nvarchar2(255) as Numeric</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057081#M354250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you do not have many fields of this type (you only mention ZipCode) you could modify your numerous load statements slightly by adding an extra field for the text version as per example given by &lt;A href="https://community.qlik.com/qlik-users/146975"&gt;petter-s&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: verdana,geneva;"&gt;&amp;nbsp; Text( ZipCode ) AS ZipCodeText,*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then DROP the numeric version, if necessary. At least that way you don't have to make too many changes to your script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 10:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Treating-nvarchar2-255-as-Numeric/m-p/1057081#M354250</guid>
      <dc:creator>lawrenceiow</dc:creator>
      <dc:date>2016-01-28T10:31:21Z</dc:date>
    </item>
  </channel>
</rss>

