Hi,
Dataset 1 : ( about Salesdetails)
Id , P1 , P2 , P3 , ...... P50
1 , 1223 , AABBB , 12Ac , ..........
Dataset 2 : (about formulas to find campaing)
ID , Formula
1 , if ((p1="123") and (Left(p2,2)="AA") ) or (Mid(P4,1,3)="A4")
2 , ....
We are combining Px( e.g. P1) values with Dataset1 P values and gets true or false. If true adds to list and at the end returns list of campaign Ids which calculation is True.
If Dataset1 has 7 rows and Datset2 has 200 rows ,loops every lines and calculate expression and it takes ~3500 ms ( for and parallel for )
And also in formulas we are using Left , Mid , Right , e.g.
Dou you have an idea to do this without loops or faster way ? (Parallel loops not fast as nornal for each loops)
Sample :
Try
Dim _list As New List(Of Class_Result)
For Each r_formul As Data.DataRow In _Formuledata.Rows
For Each r_order As Data.DataRow In _OrderData.Rows
GetResult(r_formul, r_order, _list)
Next
Next
Return _list
Catch ex As Exception
Return Nothing
End Try