Filter data table based on Column Value

Hii Team,

How can we filter Excel File which is in Tis format

Client Id | Client Name | Total-Cost | Email-Id
1 | Ankit | 1000 | ank******
2 | Jay | 0 | ja*****
3 | Avneet | USA | avk@yahoo.com

So in this table only Total-Cost containing Values should be Kept
Any other string value such as Client Avneet Contains Total-Cost USA so that must me removed using filter
Also Before removing a mail should be sent to avneet at avk@yahoo.com specifying the value in Total-Cost is incorrect

Required Values from table after filter

Client Id | Client Name | Total-Cost | Email-Id
1 | Ankit | 1000 | ank******
2 | Jay | 0 | ja*****

@NISHITHA

Follow the steps

  1. Read the data into datatable(and create teo empty datatable cloning the input dt_Valid/Invalid = dt.Clone)
  2. Use this and get the rows which are valid
    dt_Valid=dt.AsEnumerable.Where(function(x) IsNumeric(x("Total-Cost").ToString)).CopyToDataTable
  3. Use again in another assign dt_InValid=dt.AsEnumerable.Where(function(x) Not IsNumeric(x("Total-Cost").ToString)).CopyToDataTable
  4. Now write the dt_valid to excel
  5. Use for each row in datatatble on dt_invalid and use send email inside it…

Hope this helps

Cheers

HI,

FYI, another approach:

Sample20230327-1L.zip (9.6 KB)

If there is possibility multiple addresses exists in Email-Id Column, it might be better to use Grouping for preventing to send multiple emails to the address.

Regards,

Thanks @Anil_G for your approach

1 Like

Thanks @Yoichi for the sharing xaml for reference

1 Like