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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Edi1
Contributor
Contributor

Trying to resolve Error Message

Hello,

Can you please help me resolve this error.

I am not seeing a boolean data type but I am getting this error message...

Error Line: 3835

Detail Message: Type mismatch: cannot convert from boolean to String

There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.

Labels (2)
8 Replies
David_Beaty
Specialist
Specialist

Hi,

 

Can you share your Talend job design.

 

I've experienced similar when you use the shorthand java if/then/else, you need to cast the result to a string:

 

{condition}?

"value if true"

:

"value if false"

 

 

Try:

 

(String)({condition}?

"value if true"

:

"value if false")

 

Thanks

 

David

Edi1
Contributor
Contributor
Author

Ok, You might be on point with this. I think I will edit as you suggested then reply later on if I still need help.. Thanks!

 

Edi1
Contributor
Contributor
Author

Hello!

I think this error is coming from this line of codes:

 

row1.Post_Key().equals("debit")? "60" : "70"

 

I received error above cannot convert from boolean to string so I cast to a string like this, below. It is still not working. I am getting error as stated above.

((String) row1).Post_Key().equals("debit")? "60" : "70" 

 

David_Beaty
Specialist
Specialist

Hi,

 

Assuming Post_Key is a column on row1, then you should use something like:

 

(String)("debit".equals(row1.Post_Key)?"60" : "70")

 

Checking the column is equal to the literal value is null safe.

 

Thanks

 

David

Edi1
Contributor
Contributor
Author

Ok, Thanks David I will try this.

gjeremy1617088143

Connect your components first !!!! You will always have errors if you don’t connect components Edi !!

gjeremy1617088143

Cause the boolean error is because the input is not connected

Edi1
Contributor
Contributor
Author

I have it connected back before I run it. I just displaying all the palettes I am using. The error is somewhere in the tMap code. All the other tfiles are good.