table1:
LOAD *,
AutoNumber(ID,ClusterTotNum) as field1Seq,
AutoNumber(ClusterTotNum,field1) as ClusterNum;
LOAD RecNo() as ID,
*,
Alt(Peek(ClusterTotNum),0)-(Previous(field1)<>field1) as ClusterTotNum
Inline [
field1
A
A
A
A
B
B
B
B
A
A
B
B
B
A
A
A
A
A
A
B
B
B
A
A
A
A
];
Join
LOAD ClusterTotNum,
Count(field1) as ClusterSize
Resident table1
Group By ClusterTotNum;