Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
spsrk_84
Creator III
Creator III

Positive values are converted to negative values

Hi All,

I am facing quite strange issue while loading data from SQL database into Qlikview  version 12.10.0.0 i.e. i am loading data from a table and the table has columns such as Reporting,Deliver,Admin and all these fields has values 0 & 1 only in the table. But when loaded into qlikview all the 1's are replaced with -1 which is quite unexpected.

i tried the approaches such uninstalling qlikiview & installing again, qliksense was also their in my and i uninstalled it.

verified to load the same data values from excel file and they are loading absolutely fine.

If anyone has come across this kind of issue please do let me know how to resolve this issue.

Thanks,

Shivarama krishna K

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

You are probably loading from a sql table where a field is defined as bit and is returned as true/false. QlikView stores true() as -1. You can converse this like below (2 ways)

SQL SELECT [ID],

case

        when BitField= 1 then 1

        when BitField= 0 then 0

    end AS SomeColumn

    ,Cast(BitField as Int) as SomeColumn2

    

  FROM ....

View solution in original post

4 Replies
techvarun
Specialist II
Specialist II

The below thread may help you

SQL select iterprets 1 as -1

pradosh_thakur
Master II
Master II

Hi

if it gets solved then well and good else you ca use fabs() to convert it to positive number.

regards

Pradosh

Learning never stops.
stigchel
Partner - Master
Partner - Master

You are probably loading from a sql table where a field is defined as bit and is returned as true/false. QlikView stores true() as -1. You can converse this like below (2 ways)

SQL SELECT [ID],

case

        when BitField= 1 then 1

        when BitField= 0 then 0

    end AS SomeColumn

    ,Cast(BitField as Int) as SomeColumn2

    

  FROM ....

spsrk_84
Creator III
Creator III
Author

Column data type is bit thus i am getting the values 1 as -1 values.

Thank you stigchel