Filter records based on dynamic column values

Hi ,i have a tble like below .i want to filter to filter the records based on column “department” which is dynamic,where the values under that column may increase.


After filtering based on columns want to write in different excels.

can anyone help me on this.


1 Like

we can use FILTER DATATABLE activity where we can mention a VARIABLE in the value field
so that the filter will be done based on the value passed to that variable which might change dynamically along the process

were you facing any issue in using that
Cheers @avinashy

@Palaniyappan : my column values under department are that case how can i use this?

yah you can mention the variable name in the filter wizard under VALUE field…
that variable can hold dynamic value and can be assigned with dynamic value along the process
so that the filter datatable activity will filter that datatable based on the value in that variable
like this @avinashy

Cheers @avinashy

1 Like


Try these steps.

  1. use below expression to find unique departments in the DataTable.

     uniqueDT = yourDT.DefaultView.Totable(True,"Department").CopyToDataTable

Then use ForEach Row activity to iterate one by one department.

          ForEach row in uniqueDT
               filterDT = yourDT.Select("[Department] = '"+row("Department").Tostring+"'").CopyToDataTable

And then write into Excel file.

1 Like