Hello,
I *think* I see what you are looking for, but as Jim mentions, more context is better. The following produces the output you describe, for the data you have provided, but since there is only 1 line of output to go on... it is just a guess. I assume, based on the input and output you provided, that in addition to parameter and location, process and part ALSO are used as grouping variables (?), and that Count will always be 1 less than n Rows in a summary of the data. These are easy enough to change in the code below if not the case, but again... just a guess.
At any rate, try this out to see if it is what you need and if it is not, hopefully you're a quick code mod away from what you want.
Cheers,
Brady
Names Default To Here( 1 );
dt = New Table( "Sample",
Add Rows( 6 ),
Set Header Height( 46 ),
New Column( "Date/Time",
Numeric,
"Continuous",
Format( "y/m/d h:m", 19 ),
Input Format( "y/m/d h:m" ),
Set Values( [3273127800, 3273124200, 3273142200, 3273138600, 3273152400, 3273149400] )
),
New Column( "Parameter", Character, "Nominal", Set Values( {"A.1", "A.2", "A.3", "A.3", "A.2", "A.3"} ) ),
New Column( "Location", Character, "Nominal", Set Values( {"B.1", "B.2", "B.3", "B.3", "B.1", "B.3"} ) ),
New Column( "Process", Character, "Nominal", Set Values( {"C.1", "C.2", "C.3", "C.3", "C.1", "C.3"} ) ),
New Column( "Tool", Character, "Nominal", Set Values( {"E.", "E", "F", "E", "E", "G"} ), Set Display Width( 43 ) ),
New Column( "Part", Character, "Nominal", Set Values( {"F-1.1", "F-1.2", "F-1.1", "F-1.1", "F-1.1", "F-1.1"} ) )
);
/////////////////BEGIN PROCESSING
//create a summary table
dtSum = dt << summary( group(:parameter, :location, :"Date/Time"n, :process, :tool, :part), Link to original data table( 0 ) );
//create a column for easy group navigation
dtSum << new column ("plpp", character, formula(:parameter || :location || :process || :part));
//process table, from bottom up
for each ( { r }, nrow(dtSum) :: 2,
if ( dtSum:plpp[r] == dtSum:plpp[r-1],
dtSum:tool[r-1] ||= evalinsert(", ^dtSum:tool[ r ]");
dtSum:n Rows[r - 1] += dtSum:n Rows[ r ];
dtSum << delete rows ( r );
);
);
// delete rows with no duplicates
dtSum << deleteRows (dtSum << get rows where (:n Rows == 1) )
<< Move Selected Columns( {:"Date/Time"n}, To First )
<< Move Selected Columns( {:Tool}, To Last );
// rename nRows to count, after subtracting 1
dtSum:Nrows[1::nrow(dtSum)]--;
dtSum:NRows << set name ("Count");
// split out tool column
dtSum << Text to Columns( columns( :Tool ), Delimiters( "," ) );
dtSum << delete columns ({"Tool", "plpp"});