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: 
JaneYu
Contributor III
Contributor III

how to use \r\n delimiter in the tAggregateRow

I have flat source data like

Customer   OrderDate    OrderDetails

Jane1         1/2/2018        Fishoil

Jane1         1/5/2018        Oatmeal

Jane1         1/10/2018      Paper

Jane2         1/2/2018        Fishoil2

Jane2         1/5/2018        Oatmeal2

 My final output will look like the below. I tried to Concat OrderDate+OrderDetails as OrderSummary, then use tAggregateRow, group by Customer, Use LIST operation for OrderSummary. In the advanced setting, use "\r\n" as the delimiter. However, the final output doesn't have the line separator between each record. please help. Thank you.

Customer OrderSummary
Jane1 1/2/2018:Fishoil      
1/5/20180683p000009MA5A.pngatmeal      
1/10/20180683p000009MAB6.pngaper    

 

Labels (1)
3 Replies
TRF
Champion II
Champion II

I have tried using a tMap to concatenate OrderDate and OrderDetails with "\n" (or \r\n") in the middle.

The the result of tAggregateRow is as expected but the output from tLowRow or tJavaRow is not very nice of the break line in the middle of each OrderSummary value.  

Starting job test at 15:55 20/01/2018.

[statistics] connecting to socket on port 3724
[statistics] connected
Jane1
----------------------------------
1/2/2018
Fishoil
1/5/2018
Oatmeal
1/10/2018
Paper
----------------------------------
Jane2
----------------------------------
1/2/2018
Fishoil2
1/5/2018
Oatmeal2
----------------------------------
[statistics] disconnected
Job test ended at 15:55 20/01/2018. [exit code=0]

Here is the tJavaRow:

System.out.println(input_row.Customer + "\n----------------------------------");
System.out.println(input_row.OrderSummary  + "\n----------------------------------");

Hope this helps.

 

JaneYu
Contributor III
Contributor III
Author

Hi TRF,

 

Thank you for your help. My output is excel file, so Customer is  one column and OrderSummary is another column. Do you use "\r\n' as delimiter in the tAggregateRow?

 

Jane

TRF
Champion II
Champion II

Hi,

Don't know if it possible using tFileOutputExcel.

I've also tried, this is the result:

0683p000009Ls4b.png

The cell contains all the values on the same line, but when you click on the cell and enlarge verticaly the formula area, it displays as expected.

Also copy/paste to notepad++ shows that \n\r are here.