Hi @Sully,
I am not exactly sure which part of your script wasn't behaving correctly as it did not run out of the box. I made a few changes, can you see if this does what you need it to?
Names default to here(1);
dt1 = New Table( "Date test",
Add Rows( 1 ),
New Column( "Column 1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [] ) )
);
dt1 << New Column ("Year", Formula(Year(Today())));
dt1 << New Column ("Month", Formula(Month(Today())));
dt1 << New Column ("Day", Formula (Day(Today())));
//Original UpdateDate column
dt1 << New Column ("UpdateDate", Character, "Nominal", Formula (Char( :Year ) || "-" || Char( :Month ) || "-" || Char( :Day ) || "-" ||
"12.20.00.000000"));
//Option 1 - adjusting your script
dt2 = dt1 << Summary (
Group (:UpdateDate),
Link to Original Data Table (0)
);
dt2 << Delete Columns ("N Rows");
//Get the UpdateDate and add single quotes to each line
date_id = dt2:UpdateDate << Get Values;
date_ids = list();
write("List of date_ids:");
for(i=1, i<= n items(date_id), i++,
date_ids[i] = "'" || date_id[i] || "'";
write( "\!n" || date_ids[i] );
);
//Option 2 - include quotes in original column formula and then use associative array to find unique values
dt1 << New Column ("UpdateDateQuoted", Character, "Nominal", Formula ("'" || Char( :Year ) || "-" || Char( :Month ) || "-" || Char( :Day ) || "-" ||
"12.20.00.000000'"));
date_ids_2 = associative array(dt1:UpdateDateQuoted) << get keys;
write("\!n\!nDateID from associative array:\!n" || date_ids_2[1];)