Apply column filter in excel and fetch the data from rows for each filter

Hi Friends,

I have an excel as shown in the snapshot. Need to filter the column with a,b,c… and extract the value for each filter.

Appreciate the support.

image

1 Like

Hi,
Use ‘Filter data table’ activity

image

1 Like

Hi
we got two options to do that either with a SELECT Method lke this
dtA = originaldatatable.Select("[Columnname] = ‘a’ ").CopyToDatatable()
similarly for others like
dtB = originaldatatable.Select("[Columnname] = ‘b’ ").CopyToDatatable()
dtC = originaldatatable.Select("[Columnname] = ‘c’ ").CopyToDatatable()

where dtA, dtB, dtC are variables of type System.Data.Datatable with default value as New System.Data.Datatable

OR with filter datatable as @chaitanya.kulkarni suggested

may i know which column we want to filter
Cheers @krishbcd

1 Like

Hi Friends,

I have an excel as shown in the snapshot.

  1. Need to filter the column with a,b,c… in each column (G, K, P)

  2. Extract the value for each filter in each column

  3. For each filter and extra the respective value, I have to copy those values in SAP application and fetch the respective information.

I would like to get the support for the first 2 steps above.

Hi Friends,

I have an excel as shown in the snapshot.

  1. Need to filter the column with a,b,c… in each column (G, K, P)

  2. Extract the value for each filter in each column

  3. For each filter and extra the respective value, I have to copy those values in SAP application and fetch the respective information.

I would like to get the support for the first 2 steps above.

Appreciate the support.

Kindly try and let know pls for any queries or clarification
Cheers @krishbcd

1 Like

Here, I do not know, what all the items present under the columns (G,K,P). Action to be done is:

  1. Filter each column.
  2. For each filter of each column, fetch the respective value (F, J, O) and paste in SAP system to get the relevant information.

Thanks,

Means You want to filter on G,K,P for say a?
Then from filtered data you want to take data from F,J,O?

yeah…

  1. Filter one column.
  2. Identify how may filters. that means a, b, c, d under column G. b,c,d, e under K and only a under P.
  3. Fetch the values for each filter under each column (Loop).

Thanks,

You want to apply Filter for a for all three column or only on those column which having that value i.e. on G and P?
If on all three then
Just take all those values means a,b,c,d and then
In for Each loop them for Filter

  1. Apply filter on each column (one after one) G, K, P
  2. Do not know how many filters are there in each column.
  3. Identify how many filters in each column
  4. For each filter, extract the values all at one time.

Assign Array For {a,b,c,d} and List of string
Then for each value in that array
Use LookUp range In Say “G” Column only’
If lookup range gives any output other than Blank(i.e. “”) then Use Add to collection of List
So at the end You will get list of item which are present in the column “G”
similarly for “K” AND “P”

Can you please detail more? I do not know how many and what are all the filters (types) present under the columns G, K and P. Bot should identify how many and what those are.

Is your filter options i.e. a,b,c,d are fixed?

They are fixed. But there may be a chance to append more further in future.

So I would like the bot itself to identify all the filters.

So where are they ?
If they are in a column then you should put them in a array or a list

Column. I will try with List.

Yup!
after that
use
Assign Array For {a,b,c,d} and List of string:

now this will be your list

Then for each value in that array
Use LookUp range In Say “G” Column only’
If lookup range gives any output other than Blank(i.e. “”) then Use Add to collection of List
So at the end You will get list of item which are present in the column “G”
similarly for “K” AND “P”

1 Like