<?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: Import SQL Server varchar field as text containing exact value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359133#M825898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can try like below&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Text(FieldName) as FieldName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or if you wanted to import exact numeric value sql/other source into qlik then like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;num#(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FieldName&lt;/SPAN&gt;, '#','.',',') as num&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FieldName&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jul 2017 17:58:38 GMT</pubDate>
    <dc:creator>devarasu07</dc:creator>
    <dc:date>2017-07-10T17:58:38Z</dc:date>
    <item>
      <title>Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359132#M825897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to QlikView and am struggling somewhat with what should be really simple tasks.&amp;nbsp; I have a SQL Server database with a varchar field.&amp;nbsp; This field contains both numeric and non-numeric data.&amp;nbsp; The data should be numeric, so I am writing an exception report to detail where the field contains any non-numeric characters (which are preventing the value being cast to numeric in SQL).&amp;nbsp; So, I might have values such as '£1000', '1,000', '10%', '01/01/2017', '1 abc', '1000.25', or '1000'.&amp;nbsp; In SQL Server, only the last 2 values can be cast, and all of the others should be included in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I have is that Qlik seems to recognise all of those as numbers, and I am just getting the numeric value loaded into my file.&amp;nbsp; So, '1,000' is displayed as 1000 (without the comma).&amp;nbsp; I cannot format the numbers to include the missing characters, as not all of the errors are due to the same character. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be able to display the exact text as stored in SQL Server so that the report user will understand why the record appears on the report.&amp;nbsp; I have tried to find a text function in the script editor to force this at load stage, and I get a message saying the built in text function does not exist (this is the solution I find in most forums, but does not help me unfortunately).&amp;nbsp; I cannot use the function in the chart expressions, as this only converts the loaded value to text, so I am still missing the commas and £ signs etc. So, I am hoping someone out there can assist.&amp;nbsp; I am using QlikView 11 and SQL Server 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359132#M825897</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359133#M825898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can try like below&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Text(FieldName) as FieldName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or if you wanted to import exact numeric value sql/other source into qlik then like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;num#(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FieldName&lt;/SPAN&gt;, '#','.',',') as num&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FieldName&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:58:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359133#M825898</guid>
      <dc:creator>devarasu07</dc:creator>
      <dc:date>2017-07-10T17:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359134#M825899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, many thanks for your response.&amp;nbsp; However, as per the query, the text function is not working in my script.&amp;nbsp; I get an error message advising that it is not a built in function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 18:41:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359134#M825899</guid>
      <dc:creator />
      <dc:date>2017-07-10T18:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359135#M825900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dawn,&lt;/P&gt;&lt;P&gt;Try like this.. in the load statement use grave accents i.e enclose the field name inside the grave accents.&lt;/P&gt;&lt;P&gt;grave accent is something like single quote but not exactly single quote in your keyboard.&lt;/P&gt;&lt;P&gt;The grave accent (`) is under the tilde (~) key on your keyboard&lt;/P&gt;&lt;P&gt;This will help to retain the exact format as in sql server into the qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;`ID`,&lt;/P&gt;&lt;P&gt;`Name`;&lt;/P&gt;&lt;P&gt;SQL select ID&lt;/P&gt;&lt;P&gt;Name &lt;/P&gt;&lt;P&gt;from dbo.xyz;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 02:49:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359135#M825900</guid>
      <dc:creator>Siva_Sankar</dc:creator>
      <dc:date>2017-07-11T02:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359136#M825901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Text() must be in the LOAD part of the statement, not in the SQL part. Like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Data:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text(myField) as LiteralTextValue,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AnotherField,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SQL SELECT myField, AnotherField,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LOAD part is executed by QV and supports QV functions. The SQL part is executed by the DB server, and supports the function set for that server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 05:29:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359136#M825901</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-07-11T05:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Import SQL Server varchar field as text containing exact value</title>
      <link>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359137#M825902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan.&amp;nbsp; This has worked.&amp;nbsp; I didn't have the load section in the script, just the SQL Select script.&lt;/P&gt;&lt;P&gt;I will mark this as the correct answer, but the Actions button isn't working at the moment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 10:51:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Import-SQL-Server-varchar-field-as-text-containing-exact-value/m-p/1359137#M825902</guid>
      <dc:creator />
      <dc:date>2017-07-12T10:51:48Z</dc:date>
    </item>
  </channel>
</rss>

