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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Int to Doube/Char to Boolean

Hello all,
I have an excel(sheet) as my input and SFDC connection as my output with a tMap in between.
Currently it error's because it can't convert between the data types.
Type mismatch: cannot convert from String to Double
Type mismatch: cannot convert from Character to boolean
I'm trying different ways with the tMap component in the expression part to get these convert but am not having much luck.
Does anybody have any ideas to help me.
Regards Lee
Labels (2)
9 Replies
Anonymous
Not applicable
Author

Hi
Can you show us the expression you are using to convert the data type?
Shong
Anonymous
Not applicable
Author

Thank you for the reply.
Type mismatch: cannot convert from String to Double
Double.parseDouble(row7.DELIVERED_COST)
Type mismatch: cannot convert from Character to boolean
row7.SPECULATIVE_BUILD__C("Y")?1:row7.SPECULATIVE_BUILD__C("N")?0:Null
Jj5
Contributor III
Contributor III

The first error you posted (Type mismatch: cannot convert from String to Double
Double.parseDouble(row7.DELIVERED_COST) ) is usually an issue with your field types. Double click your tMap to open it, then look at the bottom where it shows the Schema editor. Here you will see all your fields; they all have types associated with them like String, Double, Int, etc. You can change them by choosing another type from the dropdown menu (right beside the field names).
Make sure that they fields are the correct type. I.e. make sure on the tMap the field that you are mapping this to "Double.parseDouble(row7.DELIVERED_COST)" is set to a double.
As for the other line "row7.SPECULATIVE_BUILD__C("Y")?1:row7.SPECULATIVE_BUILD__C("N")?0:Null" you're not actually comparing anything. I think you meant:
row7.SPECULATIVE_BUILD__C.equals("Y")?1:row7.SPECULATIVE_BUILD__C.equals("N")?0:Null
Anonymous
Not applicable
Author

Thank you,
The field is mapped to a double but still errors.
After doing more research i see others have used a tConvertType would this help both my issues ?
Lee
Jj5
Contributor III
Contributor III

Thank you,
The field is mapped to a double but still errors.
After doing more research i see others have used a tConvertType would this help both my issues ?
Lee

Could you upload a screenshot of your tMap window? I don't think the tConverType is necessary. I made some edits to my first post and I mentioned that for your second issue, you aren't comparing any fields. Did you mean to include a .equals()?
Anonymous
Not applicable
Author

This is for the int to boolen.
Jj5
Contributor III
Contributor III

That expression looks right. Are you still getting an error about a Boolean? Also could you attach a screenshot of what you see when you double click your tMap?
Anonymous
Not applicable
Author

Ok got the boolean working. By using this.
row4.Spec_Build.equals("Y")?true:row4.Spec_Build.equals("N")?false:null
Now just need to work on integer to double.
Jj5
Contributor III
Contributor III

It's going to be much easier to help you if you can take a screenshot of your tMap, making sure you drag the Schema editor so we can see all the fields. This is an example of mine: