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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sujana1621
Contributor III
Contributor III

how to merge 2 rows in a data file?

Hi,

I have data which is split into 2 rows.

For eg: A person is asked Question00 and the corresponding response is recorded. For the same question, additional details was also

asked which is recorded in a separate field which is Text and recorded in next row. What I need to show is as below for Question00

QuestionsResponseTextOrderNo
Question00Sometimescould not continue a while back.00



transf:

LOAD Questions,

     concat(Text,'/') as Text,

     OrderNo

FROM example.xlsx  (biff, embedded labels, table is Sheet1$)  group by OrderNo, Questions, Response;

But this is not working.

Thanks

Sujana

2 Replies
Nicole-Smith

Using your example file, load script like this:

Data:

LOAD SUBFIELD(SUBFIELD(Questions, ' ', 1), '?', 1) AS Questions,

     CONCAT(Response, ', ') AS Response,

     CONCAT(Text, ',') AS Text,

     OrderNo

FROM example.xlsx (ooxml, embedded labels, table is Sheet1)

GROUP BY SUBFIELD(SUBFIELD(Questions, ' ', 1), '?', 1), OrderNo;

Returns data that looks like this:

Questions Response Text OrderNo
Question00Sometimescould not continue a while back.0
Question1Yes 8
Question02Does not diagnoseNot something i look for previously2
Question04Anti-inflammatory 4
Question06Otherthinks there’s a mechanistic aspect that can cause it.6
Question08 There’s some study evidence out there.8
Question10Depends on eventcan’t tolerate it.10
Question12Yes 12
Question14<5% 14
Question16Yes 16
sujana1621
Contributor III
Contributor III
Author

Thank You Nicole Smith. It works now.