Linq to Filter datatable with two rows as header values

Hi all,

The input file is below

after reading the input file, the datatable is as below:

The required output is as below

Condition is to filter rows with Yes values in the Actual column
Any idea on how to achieve this?


Hey @Ray_Sha1

Does this mean, you want to filter rows which has values in all the 4 columns ?



Filter needs to be done based on the actual column, with values yes in it.


Okay perfect. So Filter Data Table should do the job. Did you try that please ?

Duplicate : Linq to filter data - #18 by Gokul001

Hi @Ray_Sha1

Try this LINQ

    From r in dt_Data.AsEnumerable()
    Where dt_Data.Rows.IndexOf(r).Equals(0) Or r("Actual").ToString.Trim.ToUpper.Equals("YES")
1 Like

Hey @kumar.varun2
This works correctly.


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