<?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 bit type field resulting in 0, -1 instead of 0, 1 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215294#M68766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table in a SQL db with a bit field. When I select distinct values in SQL management studio, I get 0 and 1, but in QlikView I get 0 and -1. Is there some special way I'm supposed to handle bit types? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2009 02:02:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-14T02:02:37Z</dc:date>
    <item>
      <title>SQL bit type field resulting in 0, -1 instead of 0, 1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215294#M68766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table in a SQL db with a bit field. When I select distinct values in SQL management studio, I get 0 and 1, but in QlikView I get 0 and -1. Is there some special way I'm supposed to handle bit types? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 02:02:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215294#M68766</guid>
      <dc:creator />
      <dc:date>2009-10-14T02:02:37Z</dc:date>
    </item>
    <item>
      <title>SQL bit type field resulting in 0, -1 instead of 0, 1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215295#M68767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds similar to boolean fields... QlikView treats boolean "true" as -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are consistently getting -1, then just reverse the sign during load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 02:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215295#M68767</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-10-14T02:28:30Z</dc:date>
    </item>
    <item>
      <title>SQL bit type field resulting in 0, -1 instead of 0, 1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215296#M68768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Oleg that sign should be reversed (or by using an absolute value be omitted), but would use (assuming that the name of the bit field is BitField):&lt;/P&gt;&lt;P&gt;fabs(BitField Xor 0)&lt;/P&gt;&lt;P&gt;Thus, if you expect only 0 or 1, you only GET 0 or 1 (even if BitField is not consistently read as -1).&lt;/P&gt;&lt;P&gt;But that's perhaps mere of theoretical interest ..&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>Wed, 14 Oct 2009 03:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215296#M68768</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-10-14T03:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL bit type field resulting in 0, -1 instead of 0, 1</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215297#M68769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am new to QlikView, and had the same unexpected experience using BIT values from SQL Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A work-around I used was to change the SQL load script and convert data type to INT, e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff; font-size: 10pt; font-family: Consolas;"&gt;cast&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; t&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;IsActive &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;INT&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-size: 10pt; font-family: Consolas;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; IsActive&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;Terry&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 16:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-bit-type-field-resulting-in-0-1-instead-of-0-1/m-p/215297#M68769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T16:22:03Z</dc:date>
    </item>
  </channel>
</rss>

