Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Boolean values - Looking for alternative options and results!

Looking for better alternative for working with Boolean values.  I am using SQL select, not working with QVD.

Script:

SELECT

OrderHed.OrderNum,

OrderHed.Checkbox01 as 'SymTS' // 0 or 1

FROM "SUB_SMI".dbo.OrderHed;

QV Listbox Properties:

Capture1.PNG 

QV ListBox on Sheet:  Why does the value 1 TRUE change to FALSE when value 0 FALSE is selected?

Capture2.PNGCapture3.PNGCapture4.PNG

QV Selected on Sheet:  Would prefer the Value "TRUE" or "FALSE" to appear.  Can this be done?

Capture5.PNG

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Qlikview doesn't have a boolean type. So your boolean gets loaded into qlikview as a number. If a number is used as a condition in for example an if statement then any number other than 0 is true and 0 itself is evaluated as false.

You could use the dual value to give it a text as well as a numeric value:

dual(if(OrderHed.Checkbox01,'True','False'), OrderHed.Checkbox01) as SymTS

This way SymTS will shown as True or False text values.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Qlikview doesn't have a boolean type. So your boolean gets loaded into qlikview as a number. If a number is used as a condition in for example an if statement then any number other than 0 is true and 0 itself is evaluated as false.

You could use the dual value to give it a text as well as a numeric value:

dual(if(OrderHed.Checkbox01,'True','False'), OrderHed.Checkbox01) as SymTS

This way SymTS will shown as True or False text values.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert!