Hi,
I have two external api's that return each a series of dates and values. List1 returns a TotalCount and List2 returns a CompletedCount. For each date NotCompletedCount = TotalCount - CompletedCount.
The current implementation is a ForEach List1, with a nested ForEach List2 and an if that checks if List1.date = List2.date and then perfoms the caluculation when true.
These lists are then combined to on to create a SourceDataPointList as source for a Charts\ColumnChart
If the series of dates contains 50 dates this will result in 50x50 = 2500 iterations with only 50 matches to operate on
Does anybody know how to do this in a more efficient way?
hmm, interesting :)
some ideas out of my head:
1. Use a hashtable(s), so you only have to loop though 1?
2. instead of looping, do a list-filter (not sure how that action is implemented)
and yes, sorting and remove "older" dates should be cleaning up the list for sure.
so in the last records you have a small list to loop...
Hi Paul,
If you have no control over the external apis, right now, I see two options (maybe there's more):
To large lists, I would say the 2nd is better.
Maybe somebody has a better idea...
Cheers,
José
Thanks, the hashtable is quite easy: