Typically, when doing an income statment that requires % of sales, we first select the sales accounts - the ones that would be included in the sales line- and scan them to access the results table and sum the results to a memory variable which we can later use as the denominator for the sales %.
If it works - the % of sales on the total sales line should be 100.
A SQL select joining the two might be faster, but we've always used the scan.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.