To find the percentage of repeated values in a list of strings?

Hi @sfdc_sfdc

Can you try the below

listOfValues = New List(Of String) From{"A", "B", "A", "C", "A"}

percentage = ((listOfValues.Where(Function(x) x = listOfValues.GroupBy(Function(y) y).OrderByDescending(Function(g) g.Count()).First().Key).Count() / listOfValues.Count()) * 100).ToString

Regards,

1 Like