How many different values are in a column?

Hello everyone,

I need to know how many different values in an excel column and what are these names.

Example for;

Column1 Column2
A AN
B AZ
B AN
A AW
C AX

outputs:
Column1 has 3 different values: A,B,C
Column2 has 4 different values: AN,AZ,AW,AX

How can I find it? Is there any activity or anything for this? And how can ı use it?

Thanks.

@Muhammet_Duzparmak

  1. First use Read Range activity to read the data and will give output as DataTable and say ‘inputDT’.

  2. And then try below expressions.

       firstColumnDT = inputDT.DefaultView.ToTable(True,"Column1")
    
       secondColumnDT = inputDT.DefaultView.ToTable(True,"Column2")
    

Here, True flag refers to get Unique values from mentioned columns.

2 Likes

Now ı know how many different values. How can ı know what are these names?
Because ı ll take filter data table for each of them.

1 Like

@Muhammet_Duzparmak

You can iterate that filter data using ForEach Row.

       ForEach row in firstColumnDT
              - Print row("Column1").Tostring
1 Like

It looks like it works :slight_smile: Thank a lot and best regards :))

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.