Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
tnewbie
Creator II
Creator II

Data conversion issue

Hello All,

I have a xml source which has a data element TaxID which is defined as a string in the xsd, i created my data definition from xsd. This has been working well, but i noticed that when this Taxid element is populated with a integer value, Talend denies to process that integer value through the string column...interesting when i looked at the javascript, it clearly specifies that the base definition is 'string' and the input value is integer...i can not do an explicit conversion to string because usually it is a string more over there are close to 3000 elements in that complex xml, if i start explicitly converting data types it cannot go through, as such i am already facing performance issues... can you throw some ideas here please.

 

If the incoming TaxID="abcxyz" no issues, it goes through, if the incoming TaxID=1111 it denies to process saying that can not convert integer to String

 

For your reference i am pasting the exact piece of javascript generated by Talend below...

NAME: "TaxId",
TYPE: "id_String",
NULLABLE: true,
LENGTH: -1,
COMMENT: "",
PRECISION: -1,
SOURCETYPE: "id_Integer",
ORIGINALLEHGTH: -1

 

The attached screen shots probably provide little more clarity of what i am doing

Labels (3)
2 Replies
Anonymous
Not applicable

It is difficult to identify what is causing this without an example of the XML that works and the XML that doesn't.

 

You mention Javascript that is generated by Talend. Talend generates Java and not Javascript. It's easy to confuse the two if you don't develop in Java or Javascript, but it is useful to know that you are working with Java in case you want to Google something. By the way, learning Java will help massively with using Talend. Anyway, the reason I bring this up is that I'd like to know where you go that code? It might also help identify this issue. 

You also give an example of code that works and code that doesn't ("TaxID="abcxyz" no issues, it goes through, if the incoming TaxID=1111"). Was this copied from somewhere or is this your interpretation of the data? The quotes identify a String, the lack of quotes around a number usually identify a number. This *could* be a potential cause.

If you can send some XML examples (with sensitive data removed) and maybe your XSD, it should help identify what needs to be done.

tnewbie
Creator II
Creator II
Author

@rhall  Thank you for your response. I was referring to JobScript and by mistake i have typed in as Java Script, sorry for that.

 

Coming to the actual issue I posted on the community forum:

It took a while but i am now able to overcome the issue...no further help is needed for now.

 

Thanks again and sorry for the delay acknowledgement.