i want to write linq query to filter below item for column name (
Approval and coding
170 verification procees for PO Invoice
And again one more filter in different column same file column Name - (Responsible User) i need to exclude below names if present
Ali Hayder Tokay(ATOKAY)
ok you have created list1 and list2 variable, in my case it is available in columns
below query i can write once i have filtered the data from column
FilteredDT = DT.AsEnumerable.Where(Function(x)list1.Contains(x(“Column1”).ToString) andAlso Not(list2.Contains(x(“Column2”).ToString)).CopyToDatatable.
my question is how to implement in my case
A Slight confusion again, If the values are in columns and you want to pick all the values in the columns, then the Filter for Column1 is not required at all, as you will be including all the column values.
The understanding here is that you would want to select only a few values from all the values present in the column and you would know these values before hand. Is this not the case ?
As suggested already, It would be better if you could provide us with a Sample Input and the Expected Output for that Input to be sure of the logic that we would need to apply.
i want to exclude some values from Responsible column if that names exists, again i want to select few Values like Comment Request etc… in Queue Column
i think this is very straight forward, i am one who is creating confusion here sorry for that.
i can use try filter datatable activity two time one for one column and another filter for another column, but sometimes this doesn’t work and also it will be slow, so i want to use query.
let me know if need more clarity on this.
Also, pls let me know how to replace list1 and list2 with real data which i have .
but before that i got one small issue, actually bot writing the extarcted data in excel but everything as text, but i want it should convert to Number in (Amount) column only for everytime when bot runs again and extratct the data.
Maybe for this, If you do already know the Column order in the table, we should be able to create a Excel Template having the columns names in the required format, meaning we can set the Column to General, Number, Date, etc… Then we can use Write Range activity with Add Headers unchecked with range starting from A2. After the data is entered, it should correspond to the required format in the Excel.
One other way is to use Format Cells (Modern) activity, to format the specific column to the Required type.