Hallo, ich habe eine Reihe von Spalten mit Daten für mehrere Produkte nach Zeilen. Ich muss diese Daten aufteilen, indem ich neue identische Spalten mit dem Produktnamensuffix erstelle und nur die übereinstimmenden Produktdaten aus den vorherigen Spalten kopiere. Ich brauche nur Hilfe, um die entsprechenden Daten zu kopieren. Ich habe versucht, dies mit Auswahl und Kopieren und Einfügen zu tun, aber ich bin mir nicht sicher, wie es geht. Der interessierende Bereich ist fett + unterstrichen.
Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt << Get Column Names(String);
//Select set of columns to split
for (i = nitems(colNames), i > 0, i--,
if (!contains(colNames[i], "SPC"),
remove from(colNames, i);
);
);
//Add new columns with product name suffix and copy/paste properties
Summarize(unique_values=by(:Products));
colNames2=colNames;
for (k = nitems(unique_values), k > 0, k--,
for (i = nitems(colNames), i > 0, i--,
colNames2[i] = colNames[i] || " " || unique_values[k];
dt << New Column( colNames2[i] );
);
for( j = 1, j <= nitems(colNames), j++,
colProps = Column( dt, colNames[j] ) << Get Column Properties;
Column( dt, colNames2[j] ) << Add Column Properties( colProps );
);
<U><STRONG> dt << Select Where( :Products == unique_values[k] );
dt << selectColumns(colNames);
dt << Copy;
dt << selectColumns(colNames2);
dt << Paste;</STRONG></U>
);