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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
saivsr
Contributor
Contributor

how to pass string and integer values in to string column..

Hi All,

 

I have src XML file..

 

I am getting data for one column like..Int and String value,,i want to load the data in to table..the table column has string data type.

 

Source (str&int)           Target(str)

235451562                  235451562

63453635                    63453635

jsysysfags                   jsysysfags

 

the above way i need to pass.

 

but i a, facing issue..like

 

if i parser to int then int will be the problem.

 

if i change to .toString() then String value will be the problem.

 

source by default taking input is integer.

 

Please suggest me for good solution.

 

 

 

Thank you.

 

 

 

 

 

 

 

 

Labels (3)
11 Replies
manodwhb
Champion II
Champion II

@saivsr,while readig from source if you read as sting data type you will not get any error. So read as a sting data type from XMl file for the source column.

saivsr
Contributor
Contributor
Author

@manodwhb,

 

My source is XML, i read source as document,so it is reading this column as integer based on data.

manodwhb
Champion II
Champion II

@saivsr,in Source metadata/Schema,you can change integer to sting.

 

tFileInputXml

Basic settings >>Edit schema>>change the column type from integer to sting.

saivsr
Contributor
Contributor
Author

reading source XML reading data type as Document..so i con't change my data type.

manodwhb
Champion II
Champion II

@saivsr,can you post your job design?

manodwhb
Champion II
Champion II

@saivsr,if you are reading as Document,you can conevrt data type from Documnet to Sting in tXmlMap or tJavarow.

row1.col.toString()

 

saivsr
Contributor
Contributor
Author

pfa

 

Monohar,,i have tried many functions for this.

 

.toString(),

String.ValueOf()

 

,TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy"

TalendDate.formatDate("MM/dd/yyyy HH:mm:ss",TalendDate.parseDate("EEE MMM dd HH:mm:ss z yyyy",row1.CREATED_ON))

 

Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])=1?[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]:Integer.parseInt([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])


[row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()


Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM]=1)?[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]:
Mathematical.INT([row12.doc:/asx:abap/asx:values/TAB/item/USNAM])

 

[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].equals(null)?"":Mathematical.NUM([row2.doc:/asx:abap/asx:values/TAB/item/USNAM])!=1?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]:[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()


[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].equals(null)?"":[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].length>0?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]:[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()


StringHandling.LEN([row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString())>0?[row2.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():[row2.doc:/asx:abap/asx:values/TAB/item/USNAM]


Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim()==1)? [row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():null


Mathematical.NUM([row12.doc:/asx:abap/asx:values/TAB/item/USNAM]==1)? [row12.doc:/asx:abap/asx:values/TAB/item/USNAM].toString().trim():[row12.doc:/asx:abap/asx:values/TAB/item/USNAM]

 


Capture.PNG
manodwhb
Champion II
Champion II

@saivsr,do you import XML tree structe for tXmlmap fro input section?

saivsr
Contributor
Contributor
Author

Yes Manohar