Aha, now we have a new case and expression.
Well, is your IIF the same as the difference of the tow IIFs? Not directly, and I'd not even look into it, because we have ICASE to cover more than 2 cases, far easier.
As I already wrote, this expression would be either amount or -amount:
Code:
ICASE(flowtype=8,amount,flowtype=6,-amount,0)
Which is assuming inflow (flowtypeid=8) should be taken positive and outflow negative.
If you want the difference, you don't need to summarize the expressions, you could simply output reportvariable2-reportvariable1 in a difference report field, or reportvariable1-reportvariable2, depends on which is about inflow and which about outflow.
Well, and one more thought, since the current two report variables are computed already, neither ICASE nor a nested IIF is better optimized as the difference of the two reportvariables. When you start over computing a result looking at the flowtypeid and deciding whether the result should be amount or -amount, you repeat what's already been done twice already, so reportvariable3 defined on the basis of the previous two reportvariables is the best way you can do this without erroring, even if you care about not repeating calculations/computations/evaluations.
But you don't even need a third reportvariable, you can set a repert field to an expression like reportvariable2-reportvariable1, too.
We didn't yet talk about what names your two report variables have. The report might mangle your data in unexpected ways, if you name them as table fields are named, so watch out what you name the reportvariables and whether that collides with data field names, too.
Chriss