DataTable.select() versus FilterDataTable activity

I will try to summarize it very simply.

  1. Filter Data Table activity works very well with STRING type data.
  2. If you use Filter Data Table activity then you cannot play with type conversions. Also if you want to filter using conditions on multiple columns that too of different type, the output will be not the expected one. For example, you want to filter the data from excel/csv with condition like:
    Age >30 and Gender = “MALE” and Height >5.5
    For this situation to achieve this you have to use multiple Filter Data Table activity, one after another in a sequence

Instead, a simple way is to

  1. Use Excel Application Scope
  2. Use Read Range activity
  3. Use Assign activity,
    image
    var_customDT = var_DT_client126.Select("Age > 30 AND Gender = ‘MALE’ AND Height > " + var_height).CopyToDataTable

Note : var_DT_client126 is the name of my data table and var_height is a variable holding height value and var_customDT is the variable that will hold the output of select statement & its type is DataTable

So, as you can notice in a single line we are able to filter the complete data

8 Likes