thank you @txnelson for your solution. This works perfectly in find the duplicate columns and how many times they were duplicated. The issue I'm having now is that I'm trying to find the top N (ex: N =5) repeated strings and throw them in a list for further evaluation. I was only being able to find the top item in the list.
My question, is there are a way to find the top N items where N can be any integer? Thanks!
I have modified the code as seen below:
names default to here(1);
dt=current data table();
// Get each different string value and the number of repeated strings
summarize(dt, byGroup = by(:Temp_), number = count(:Site));
list = {};
list[1] = 0;
// To find which rows that have the same values
for(i=2, i <N Items(byGroup),i++,
list[i] = N Items ( theRows = dt << get rows where( :Temp_ == byGroup[i] ) ) ; // creating a list of how many times those items were repeated.
//numoffail = N items(list);
buf = max(list); // finding how many times the top repeated items were repeated.
highest =byGroup[loc(list,buf)]; // match the number of repetition to the repeated string to find the most repeated
);