Skip to content
logo Knowledgebase

Sage 200 Report Designer - How to write IF statements in Report Designer

Created on  | Last modified on 

Summary

This article explains how to create an IF statement within Sage Report Designer.

Description

NOTE:

This article has been prepared and issued to you as a goodwill gesture only and Sage accepts no liability or responsibility for its use. For further support please refer to your Business Partner.

Resolution

IF statements in the old Report Designer are replaced by a new mode of expression in the new Report Designer.

Old Report Designer New Report Designer Means
IF    
THEN ? If True
ELSE : Else
Example

To distinguish between positive and negative data in a sales order report that picks up invoices and credit notes, the program uses the record Type to distinguish between positive and negative and so the data itself is unsigned.

Using the old Report Designer, you would have created an expression that looked like this:

If ( SOPInvoiceCredit.SOPInvoiceCreditTypeID = 0, 1, -1 ) * SOPInvoiceCredit.InvoicedGrossValue

This assumes that the report is looking at standard invoices and credit notes, and if the TypeID is 0 (an invoice), you would multiply by 1, else you would multiply by -1.

Using the new Report Designer, to achieve the same result, you would create an expression that looks like this:

SOPInvoiceCredits.SOPInvoiceCreditTypeID = 0 ? SOPInvoiceCredits.InvoicedGrossValue : SOPInvoiceCredits.InvoicedGrossValue * -1

NOTE:

If you are viewing this article from the Sage website, a list of Sage 200 Report Designer articles are now available.