In my csv file having the columns named OPEN, CHNG and VALUE I want to filter the data based on the below condition, can anyone please help me on the solution.
OPEN >5000
CHNG should only positive numbers
VALUE > 515974237
In my csv file having the columns named OPEN, CHNG and VALUE I want to filter the data based on the below condition, can anyone please help me on the solution.
OPEN >5000
CHNG should only positive numbers
VALUE > 515974237
Try below expression.
OutputDT = InputDT.AsEnumerable.Where(Function(row) Cint(row("OPEN")) > 5000 AND Cint(row("CHNG")) > 0 AND Cint(row("VALUE")) > 515974237).CopyToDataTable
@lakshman - How to use this expression? In which activity I have to use?
Stick with Pratash’s solution using the activity if the expression is not clear.
Effectively they both do the same.
Step 1: read the file using the ‘Read CSV’ activity. The output datatable will contain all your data. Be sure to flag the ‘Has headers’ box.
Step 2: apply any of the solutions posted above.
Step 3: Happy faces, you’re done as far as your request goes.
*Please note the typo in the expression: AsEnumersble should be AsEnumerable
Use Assign activity
Left-hand: OutputDT
Right-hand: InputDT.AsEnumerable.Where(Function(row) Cint(row("OPEN")) > 5000 AND Cint(row("CHNG")) > 0 AND Cint(row("VALUE")) > 515974237).CopyToDataTable
Here, OutputDT is of type System.Data.DataTable and InputDT variable holds input data from Excel file.