Thu Aug 11, 2022 8:16 pm
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.



SORT required for ITERATE?

Topics specific to using ECL from a Data Analyst standpoint

Tue Nov 17, 2015 10:27 pm Change Time Zone

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.
janet.anderson
 
Posts: 52
Joined: Wed Jul 17, 2013 5:31 pm

Wed Nov 18, 2015 3:07 pm Change Time Zone

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
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1006
Joined: Wed Jun 29, 2011 7:13 pm


Return to ECL for Analysts

Who is online

Users browsing this forum: No registered users and 2 guests

cron