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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Converting multiple rows into one

Hi, I have a fixed flow input producing three rows, each with the field 'name' and 'role.
I want to output all of the rows in a single row and single field in the fileoutputdelimited.
The reason for this is that I need to convert the incoming rows to a json like format.
(I already know about the component to write json fields - it's not what I need)
I've tried using jJavaFlex with the main block building a string and the end block propagating the row, but it seems to just pass a row out for each incoming row anyway.
Labels (4)
6 Replies
Anonymous
Not applicable
Author

Hi,
Try this: tFixedFlowInput------row1---(main)------tJavaRow
suppose you put your three colmun in a context variable
In your tJavaRow : context.mergethreerow=row1.column1+row1.column2+row1.column3;
Anonymous
Not applicable
Author

Thanks, but I actually need values from each row to combine into a single field in a single row e.g.
So input rows are (just an example):
Row1
--------
name: Mike
role: Author
Row2
------
name:Jo
role: Illustrator

tFixedFlowInput .... row1(main) (2 rows)---> tJavaFlex ------ row2(main) (1 row) -----> tOutputFileDelimeted

Output would be 1 row containing:
Attributex: { "contributors" : }
If anyone can achieve this exact output using another component that already exists please let me know.
In my real job, I don't want to append the rows to a variable and then use a separate subjob, because this flow is contributing to an XML file that's being built, and I don't think I can add into the XML structure after the file is written? he above is just an example to illustrate the principle of many rows to one.
Anonymous
Not applicable
Author

I read another thread on this forum and am following the advice there, the job isn't working yet, but I think it will.
Anonymous
Not applicable
Author

Please post this topic URL so someone reading this will get to the solution quicker 0683p000009MACn.png
Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

HI ,
I have the Table with columns "REPORT_INFO_ID","REPORT_ID","SECTION_CODE","SOURCE_NAME","JSON_OUTPUT","METRIC_NAME","SEQUENCE"
"JSON_OUTPUT" column has JSON format in multiple levels  (Means each record in that column has a json format).
json files are there as per source systems...now how i can process the data.
sample data as in below:
 
REPORT_INFO_ID REPORT_ID SECTION_CODE SOURCE_NAME JSON_OUTPUT METRIC_NAME SEQUENCE
16 2 APIGEE_AVG_RESP_TIME APIGEE


To see the whole post, download it here
OriginalPost.pdf