SORT required for ITERATE?
I was reviewing the code of a co-worker who is a stat modeler not familiar with ECL. He was doing a GROUP and then an ITERATE. I was concerned because there was no SORT within his grouping and he was trying to determine the change in a value between consecutive records. But strangely the ECL Language Reference doesn't mention sorting with regards to ITERATE at all and the examples don't use SORT either. Am I missing something? Shouldn't ITERATE be as dependent on sort order as a function like DEDUP (where the documentation does mention SORT)?
Thanks for any feedback.
Thanks for any feedback.
- janet.anderson
- Posts: 52
- Joined: Wed Jul 17, 2013 5:31 pm
Hi Janet,
SORT is not required for ITERATE, but in some cases, yes, it can help. There may be some uses of ITERATE (like sequencing records) where a SORT is definitely not needed. The success of the ITERATE depends on how it is used, and it is not always required to SORT.
Using a DEDUP, a sorted recordset based on the DEDUP condition is definitely required.
But yes, if ITERATE was to be used on a GROUPed dataset, the GROUP of course should be SORTed.
HTH,
Bob
SORT is not required for ITERATE, but in some cases, yes, it can help. There may be some uses of ITERATE (like sequencing records) where a SORT is definitely not needed. The success of the ITERATE depends on how it is used, and it is not always required to SORT.
Using a DEDUP, a sorted recordset based on the DEDUP condition is definitely required.
But yes, if ITERATE was to be used on a GROUPed dataset, the GROUP of course should be SORTed.
HTH,
Bob
- bforeman
- Community Advisory Board Member
- Posts: 1006
- Joined: Wed Jun 29, 2011 7:13 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest