I need to check if in my excel column values “Charges” is matching queue item value “SkuName”. and excel column value"ListPrice(Quantity)" matches sku item value “ListPrice”
I need to loop the entire data table and find a match if current row column values “Charges” is matching queue item value “SkuName” and current row column value “ListPrice(Quantity)” matches sku item value “ListPrice”
When ever a match is found do nothing else add the sku item
But the problem is I am using for each row in Data Table,
Since in the first column its not finding match its going to else block and adding the queue item even though somewhere in bottom rows the match is found
How do I build the query and logic for this where its seraches in one shot entire data table and if match is found don’t add else add queue item
Why not use a filter datatable to check if match is found instead of for each
Another way if you want for eqch is use a boolean variable…set to true if found…on not found side do nothing…also you can use break on the true side sao that remaing rows neednot be checked
And after loop check if values is true then dont add else add or viceversa based on what you need
I first need to use the regex expression for “ListPrice(Quantity)” column to remove $ and USD and then use filter data table. Can I achieve all this in Linq Expressions. first regex expression for column ListPrice(Quantity) Regex expression and then filter data table to compare? I am unable to get the Linq expressions
“\d+.\d{2}\d*(?<=[1-9])|\d+.\d{2}”)
Like apply regex to column “List price (Quantity)” column and then use filter data table query to compare the column values
if column value List price (Quantity) =ListPrice (queue item) AND “Charges” = SkuName
I want to combine these two expressions: Can you please help on combining the two expressions : First one is regex and second one I want to use filter data table
Code to be pasted in the invoke code method.
ou_RowCount= dtInput.AsEnumerable().Where(Function(row) row(“Charges”).ToString()= in_Charges and row(“Price”).ToString= in_Price.ToString).ToList().count
Kindly note that - use regex and format price value before passing to this code segment. Once the code run is completed - get the output to a variable and check whether the count is greater than 1 or not