<?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 SQL select iterprets 1 as -1 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288705#M1183075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have a line on the issue...&amp;nbsp; The field is a not null bit in one place and a null integer in 2 other places.&amp;nbsp; QlikView is getting confused about what context to show a null or a minus one from one place when there is a zero in another.&amp;nbsp;&amp;nbsp; Great; QlikView is helping me find data structure problems in the Data Warehouse! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miquel:&amp;nbsp; What is the potention advantage to using the load statement before a SQL select?&amp;nbsp; By the way, I'm using an OLE connection to SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers and thanks all,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Dec 2011 21:29:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-08T21:29:53Z</dc:date>
    <item>
      <title>SQL select iterprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288702#M1183072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SQL field that only contains the values -1, 0 and 1.&amp;nbsp; In the resulting QlikView data, I'm only getting -1 and 0.&amp;nbsp;&amp;nbsp; All of the rows with a positive one in SQL have been converted to -1 in QlikView.&amp;nbsp; Am I missing&amp;nbsp; something to maintain the 3 distinct values?&amp;nbsp;&amp;nbsp; I have other SQL tables with mixtures of negative and positive numbers in them that are working - the only difference is a much wider range of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my SQL statement:&amp;nbsp; The offending field is the one I'm aliasing as Inter_Company_Key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;SQL SELECT "Customer_Group_Key",&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Customer_Key",&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Customer_Name",&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Customer_Tier_Key",&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Internal_Customer_Key" as Inter_Company_Key,&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Record_Update_Date" as Customer_Last_Updated.&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; "Superior_Customer_Key"&lt;/P&gt;&lt;P style="text-align: left;"&gt;FROM EODS.dbo."CUSTOMER_DIM"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Many Thanks for your help,&lt;/P&gt;&lt;P style="text-align: left;"&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 18:57:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288702#M1183072</guid>
      <dc:creator />
      <dc:date>2011-12-08T18:57:35Z</dc:date>
    </item>
    <item>
      <title>SQL select iterprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288703#M1183073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Try timesing by 1, or adding 0 to force it to have a look at what it's doing. Most unusual problem though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; "Internal_Customer_Key" * 1 as Inter_Company_Key, or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; "Internal_Customer_Key" +0 as Inter_Company_Key, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 19:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288703#M1183073</guid>
      <dc:creator />
      <dc:date>2011-12-08T19:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select iterprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288704#M1183074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try LOADing the fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD Customer_Group_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer_Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer_Tier_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inter_Company_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer_Last_Updated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Superior_Customer_Key;&lt;/P&gt;&lt;P&gt;SQL SELECT "Customer_Group_Key",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Customer_Key",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Customer_Name",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Customer_Tier_Key",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Internal_Customer_Key" as Inter_Company_Key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Record_Update_Date" as Customer_Last_Updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "Superior_Customer_Key"&lt;/P&gt;&lt;P&gt;FROM EODS.dbo."CUSTOMER_DIM"&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if it's related to the driver or that QlikView interprets the field as true/false (although there are no boolean fields as such in QlikView), where false is 0 and true everything else (usually -1 or 1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 20:25:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288704#M1183074</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-12-08T20:25:25Z</dc:date>
    </item>
    <item>
      <title>SQL select iterprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288705#M1183075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have a line on the issue...&amp;nbsp; The field is a not null bit in one place and a null integer in 2 other places.&amp;nbsp; QlikView is getting confused about what context to show a null or a minus one from one place when there is a zero in another.&amp;nbsp;&amp;nbsp; Great; QlikView is helping me find data structure problems in the Data Warehouse! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miquel:&amp;nbsp; What is the potention advantage to using the load statement before a SQL select?&amp;nbsp; By the way, I'm using an OLE connection to SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers and thanks all,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 21:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288705#M1183075</guid>
      <dc:creator />
      <dc:date>2011-12-08T21:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select iterprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288706#M1183076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the LOAD, although not required, gives you the QlikView soul to your data alowing you to really &lt;STRONG&gt;control what data is put into&lt;/STRONG&gt; QlikView memory rather than &lt;STRONG&gt;controlling what you pull from&lt;/STRONG&gt; the data source (in this case, a SQL statement, but there are a few more, like an excel file, or a hardcoded mapping table). There are dozens of functions you can use in QlikView, conditionals, accumulations, string modifiers, formatting, date and time... that otherwise would require hours of implementation in the data source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always use the LOAD statement and I'd never think of a new project without using it in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some interesting posts in the QlikCommunity about the use and advantages of LOAD, but I recommend you to check &lt;A _jive_internal="true" href="https://community.qlik.com/thread/13682"&gt;this thread&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 22:27:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/288706#M1183076</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-12-08T22:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: SQL select interprets 1 as -1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/1558186#M1183077</link>
      <description>&lt;P&gt;Passing data from a field of one type (say bit) into a field of another type (say int) is no crime. Your system will implement default type conversion rules, or fail, depending on how it is configured, or you will explicitly cast your type conversion.&lt;BR /&gt;&lt;BR /&gt;What astounds me is that QlikView should take a &lt;EM&gt;bit&lt;/EM&gt; data field and &lt;EM&gt;change&lt;/EM&gt; the values.&lt;/P&gt;&lt;P&gt;An interesting article (link below) suggests QlikView internally uses only 2 data types: strings and numerics. That being the case I would have thought the values '0' and '1' (from a bit column in SQL Server, say) are very clearly numeric. There is no justification for modifying those to '0' and '-1'. Doing so suggests QV actually attempts to track a &lt;EM&gt;third&lt;/EM&gt; data type, not mentioned in the article, which is &lt;EM&gt;true&lt;/EM&gt; and &lt;EM&gt;false&lt;/EM&gt; represented - inexplicably - by -1 and 0, respectively.&lt;/P&gt;&lt;P&gt;Even if you accept QlikView attempting data conversions, why, oh why, did they settle on '-1' to represent 'true' when every other programming language I can think of uses '1' for same, and '-1' to represent an error condition? I mean QlikView is saying "I understand that &lt;EM&gt;1&lt;/EM&gt; represents &lt;EM&gt;true&lt;/EM&gt; to you, so I will represent your &lt;EM&gt;true&lt;/EM&gt; as &lt;EM&gt;-1&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.resultdata.com/qlikview-data-types/" target="_blank" rel="noopener"&gt;https://www.resultdata.com/qlikview-data-types/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 00:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-select-iterprets-1-as-1/m-p/1558186#M1183077</guid>
      <dc:creator>youcantryreachingme</dc:creator>
      <dc:date>2019-05-22T00:59:54Z</dc:date>
    </item>
  </channel>
</rss>

