<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to combine rows with same value in one column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767036#M94721</link>
    <description>&lt;P&gt;Oh I'll try this! If it works that would be perfect and so much easier than the convoluted process I was trying.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 12:56:07 GMT</pubDate>
    <dc:creator>Agustin</dc:creator>
    <dc:date>2024-06-19T12:56:07Z</dc:date>
    <item>
      <title>How to combine rows with same value in one column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767022#M94719</link>
      <description>&lt;P&gt;I have a data table that follows this format:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Example",
	Add Rows( 5 ),
	New Column( "Time Stamp",
		Character,
		"Nominal",
		Set Values( {"1", "2", "3", "4", "5"} )
	),
	New Column( "Sample Name",
		Character,
		"Nominal",
		Set Values( {"Sample_1", "Sample_1", "Sample_2", "Sample_2", "Sample_2"} )
	),
	New Column( "Test1",
		Numeric,
		"Nominal",
		Set Values( {1, 0, 1, 0, 0} )
	),
		New Column( "Test2",
		Numeric,
		"Nominal",
		Set Values( {0, 1, 0, 1, 0} )
	),
			New Column( "Test3",
		Numeric,
		"Nominal",
		Set Values( {0, 0, 0, 0, 1} )
	)
);

dt = New Table( "Example",
	Add Rows( 2 ),
	New Column( "Time Stamp",
		Character,
		"Nominal",
		Set Values( {"1", "3"} )
	),
	New Column( "Sample Name",
		Character,
		"Nominal",
		Set Values( {"Sample_1", "Sample_2"} )
	),
	New Column( "Test1",
		Numeric,
		"Nominal",
		Set Values( {1, 1} )
	),
		New Column( "Test2",
		Numeric,
		"Nominal",
		Set Values( {1, 1} )
	),
			New Column( "Test3",
		Numeric,
		"Nominal",
		Set Values( {0, 1} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So Sample_1 is tested against Test1 and Test2 and each row shows the result for that test. If one of the tests is not done for that row, the default status for that test is 0. That's why in row 1, Test2 and Test3 show as 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to combine these so that the final output is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Result",
	Add Rows( 2 ),
	New Column( "Time Stamp",
		Character,
		"Nominal",
		Set Values( {"1", "3"} )
	),
	New Column( "Sample Name",
		Character,
		"Nominal",
		Set Values( {"Sample_1", "Sample_2"} )
	),
	New Column( "Test1",
		Numeric,
		"Nominal",
		Set Values( {1, 1} )
	),
		New Column( "Test2",
		Numeric,
		"Nominal",
		Set Values( {1, 1} )
	),
			New Column( "Test3",
		Numeric,
		"Nominal",
		Set Values( {0, 1} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I don't care too much about the Time Stamp column. In reality there are many other columns that do not have the same value for the repeat samples. But for this analysis I would like to keep the values of the first row with that sample name. As shown in the result table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somehow I need to select the rows for which the sample name is the same, sum the relevant columns together and combine into a results table. But I'm getting stuck on how to even start. Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:48:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767022#M94719</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2024-06-19T12:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine rows with same value in one column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767035#M94720</link>
      <description>&lt;P&gt;Maybe Summary table is enough for you?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1718801524557.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65408i0BA257334A9F4559/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1718801524557.png" alt="jthi_0-1718801524557.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You might have to do additional join to get the extra columns&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:53:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767035#M94720</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-19T12:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine rows with same value in one column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767036#M94721</link>
      <description>&lt;P&gt;Oh I'll try this! If it works that would be perfect and so much easier than the convoluted process I was trying.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:56:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-combine-rows-with-same-value-in-one-column/m-p/767036#M94721</guid>
      <dc:creator>Agustin</dc:creator>
      <dc:date>2024-06-19T12:56:07Z</dc:date>
    </item>
  </channel>
</rss>

