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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
veeaar
Contributor
Contributor

Combining other database columns in tmap alonng with output from twritejsonfield

i have query as source and i am having 5 fields in the query out of which 3 fields needs to be converted to json format and other 2 fields should be mapped to the target column as is.

i passed the 3 fields to the twirteoutput and i am able to create a json struture out of them but i am not getting how to get the other 2 columns to the target without passing to twritejsonfield.

Labels (3)
4 Replies
Anonymous
Not applicable

Hi

Before passing the data to twriteJsonField. merge all columns from the 2 data source using the key field if there exists key field, if not, add a sequence number to each row for each data source, and then merge all columns using the sequence number.

 

Regards

Shong

veeaar
Contributor
Contributor
Author

i dnt have 2 sources.i have only one source which has 5 columns out of which 2 columns should be mapped directly to target and combine other 3 columns to json and map to the target

Anonymous
Not applicable

@Vee aar​ , for better understanding of your question, can you show us an example to explain your requirement? What are input data and what are your expected output?

 

gjeremy1617088143

Hi, @Vee aar​ , you could use tFlowToIterate component, it will stock all the values of your fieds in globalMap fo each iteration of the main flow.

So you could do tmap --> tflow to iterate -->iterate -->trowgenerator to generate the fields for twritejsonField and after in a tjavarow with the two other field in the output schema you can add the other values

(you could access to each value of each field at any time of the iteration subjob )

example :(String)globalMap.get(the main row name before the iteration.your field)

https://help.talend.com/r/vn0o8XYVXXNgJkRtWjet9A/rO~NmIodE3lFEuvk_wj7yQ

Send me love and Kudos