Is there a simple ABL equivalent for this SQL statement:
SELECT a,b,c,d,e,f,g,sum(h) from ... group by a,b,c,d,e,f,g
I found some aggregate functions in the doc but they are difficult to understand - to be honest.
FOR EACH xxxx NO-LOCK
BREAK BY a BY b BY c BY d BY e BY f BY g:
DISPLAY a b c d e f g h(TOTAL).
END.
check out accum function or accumulate statement (doh, how bout ambiguous syntax)… those should work with last-of on your right most group field.
o.k, I aggregated both code example into this:
for each .. break by a by b by c by d by e by f by g:
if last-of(g) then
disp a b c d e f g h(total).
end.