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

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.

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

Cause
Resolution

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

Old Report DesignerNew Report DesignerMeans
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



Sage Business Partners can now log new cases online!

If you're unable to find the help you require from our online resources, log a new case with us without having to use phone or email. Simply select 'Manage your cases' from the dashboard or visit my.sage.co.uk/cases.



Steps to duplicate
Related Solutions