Conditional sum

edited 10:21AM in FastReport 4.0
Hi all.

I need to do some conditional summing in my report footer. One sum for positive field values, and one for negative values.

I understand from some old post that this can't be done by the SUM in a memo, so instead it must be done by code in event attached to the detail band.
Is this still the same? Not possible to combine a SUM with a IIF in a memo?

Comments

  • edited 10:21AM
    Figured it out! Must have been something wrong with the syntax. This works:

    [Sum(IIF(<Qry1."Amount"> > 0,<Qry1."Amount">,0))]

    and returns the sum of positive values in Amount.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.