cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
NVarz
Level II

Merge Rows of Text Data

Hi, 

 

I have an Excel file with Text Data in it. The format of the data in the Excel file looks something like this: 

Screenshot 2021-08-03 154447.png

I want to merge the text in the Document Body Col in a single cell based on the Document Title. For example, instead of having two rows for File Name 1, I want one row for File Name 1 with the Document body concatenated together. This is not possible in Excel due to the character limit being exceed. Is there a way to perform this task in JMP Pro?

 

Thanks,

-N

NV
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Merge Rows of Text Data

Using Query could work:

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("Title", Character, "Nominal", Set Values({"A", "A", "B", "B", "B"})),
	New Column("Body", Character, "Nominal", Set Values({"A", "B", "C", "D", "E"}))
);

Query(Table(dt, "dt1"), "Select title, GROUP_CONCAT(body, ' ') FROM dt1 group by title");

SQL Functions Available for JMP Queries 

 

You might also be able to do this with some split/stack/combine columns combination.

 

Edit: Using Transpose:

jthi_3-1628022413589.png

Result table:

jthi_4-1628022424419.png

Use Combine Columns with Row 1 - Row 3 selected:

jthi_5-1628022466770.png

Result:

jthi_6-1628022492015.png

Delete unnecessary columns:

jthi_7-1628022506271.png

 

 

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Merge Rows of Text Data

Using Query could work:

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("Title", Character, "Nominal", Set Values({"A", "A", "B", "B", "B"})),
	New Column("Body", Character, "Nominal", Set Values({"A", "B", "C", "D", "E"}))
);

Query(Table(dt, "dt1"), "Select title, GROUP_CONCAT(body, ' ') FROM dt1 group by title");

SQL Functions Available for JMP Queries 

 

You might also be able to do this with some split/stack/combine columns combination.

 

Edit: Using Transpose:

jthi_3-1628022413589.png

Result table:

jthi_4-1628022424419.png

Use Combine Columns with Row 1 - Row 3 selected:

jthi_5-1628022466770.png

Result:

jthi_6-1628022492015.png

Delete unnecessary columns:

jthi_7-1628022506271.png

 

 

 

-Jarmo
NVarz
Level II

Re: Merge Rows of Text Data

Hi J! Thank you so much! That worked. Appreciate your help

NV