Tuesday, 10 September 2013

Conditional filtering for grouping

Conditional filtering for grouping

Not sure if the question is correct, as I'm having some trouble with what
the term is for what I'm looking for exactly. Have the following data:
int? Sequence
Date theDate
int? anID
What I need to do is apply the following rules to this sequence (LINQ):
• no 2 elements which have a Sequence have the same non-null anID's
• no 2 elements have the same theDate and anID's if one of them has a
Sequence
• element N's theDate is more recent than element N-1s Date
• element N's theDate = element N-1s theDate AND element N's Sequence >
element N-1s Sequence
How do I manage this? Do I need to use nested group by's? Will this be
conditional group by's?
Am a little lost on my implementation and terminology and will update
question if I get a better understanding of the solution.strong text

No comments:

Post a Comment