Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show DB2 Boolean True/False as Y/N in Qlickview

Hello,

I have a Boolean field in my DB2 database that is Null, True or False. When selecting in DB2 I can select the True and False values with the next statement.

case when a.PPCO_IND_MUTTOT=X'01' then 'J' else

case when a.PPCO_IND_MUTTOT=X'00' then 'N' else

  1. a.PPCO_IND_MUTTOT end end

How do I convert this statement in de LOAD section in Qlickview?

The Null value is converted by this statement

If ( IsNull ( PPCO_IND_MUTTOT ) = -1 , 'NULL' , 'OTHER' ) AS PPCO_IND_MUTTOTM

Anyone knows how to convert de True and False values?

Thanx!

Michel

1 Solution

Accepted Solutions
Not applicable
Author

Hello,

Well the problem is solved. Unit4 helped me solve this boolean load problem.

The select is changed as follows:

All the needed fields have been summed up instead of using a *.

And for the boolean fields the Case When is added.

PPCO_IND_MUTTOT,

CASE WHEN PPCO_IND_MUTTOT=X'01' THEN 'J' ELSE    CASE WHEN PPCO_IND_MUTTOT=X'00' THEN 'N' ELSE  'NULL' END END AS PPCO_IND_MUTTOT,

In the load you also add the field PPCO_IND_MUTTOT even if this is a new field that does not exists in the source table and that looks like:

Load

PPCO_IND_MUTTOT, 

Now it works fine.

Michel

View solution in original post

16 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

When you are loading into Qlikview how the true/false values are retrieving, can you load this

SELECT DISTINCT PPCO_IND_MUTTOT

FROM Tablename;

based on the values try using If()

If(Value = 1/True, 'Y', If(Value = 0/False, 'N', 'N/A'))

Regards,

Jagan.

MayilVahanan

Hi

May be try like this


Pick(Match(PPCO_IND_MUTTOT,'01','00')+1,'Null', 'J','N') As PPCO_IND_MUTTOT

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil,

Thanx for the effort but only the Null has been recoqnised and not the true en a false.

Not applicable
Author

Hi Jagan,

Thanx for the suggestion but I get the next error message:

Field not found - <True>

SQL SELECT *

FROM PARTSPLAN.PPCO_CONDITIE

WHERE PPCO_EINDDATUM = '31-12-9999'

Any options?

jagan
Luminary Alumni
Luminary Alumni

Try this

If(PPCO_IND_MUTTOT= True(), 'Y', If(PPCO_IND_MUTTOT= False(), 'N', 'N/A'))

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

This should be the full statement, but again it only results in Null and Other.

If(IsNull(PPCO_IND_MUTTOT) = -1,'NULL',If(PPCO_IND_MUTTOT= True(), 'JA', If(PPCO_IND_MUTTOT= False(), 'NEE', 'OTHER'))) AS PPCO_IND_MUTTOTM,

Thanx though

MayilVahanan

Hi

Can you provide a sample file?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Sample file is attatched.

If you select OTHER the you see, when you search the column right next to it (the original field from de db2 database), that 2 empty values are available, one being the true en one being false.

Hope it helps!

Michel

Not applicable
Author

It's not text but thanx for helping

sample file attached in reaction to Mayil