If, Then, Else Statement
Posted: 11 Feb 2020, 14:35
Good afternoon,
I am currently designing a Sage report for importing as a csv to a courier app for international customs invoices and am looking for help with If, Then, Else Statements.
On Sage I have designated INVOICE.NOTES_2 as the 'cell' in which a 'Y' should be placed by the user if a customs invoice is required. If the cell has a 'Y' then a series of information needs to included in the csv, if not 'Y', then leave it blank or "". The expressions I have created are:
INVOICE.NOTES_2 in ("Y","y")? "Commercial" : ""
INVOICE.NOTES_2 in ("Y","y")? INVOICE.INVOICE_NUMBER : ""
SALES_DEL_ADDR.COUNTRY_CODE in("AU")? "N" : ""
INVOICE.NOTES_2 in ("Y","y")? "GB550187XXXXXX" : ""
INVOICE.NOTES_2 in ("Y","y")? "GB" : ""
INVOICE.NOTES_2 in ("Y","y")? "0.00" : ""
INVOICE.NOTES_2 in ("Y","y")? INVOICE.ANALYSIS_1 : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.VAT_REG_NUMBER : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.TELEPHONE : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.E_MAIL : ""
The problem is, whilst the expression is accepted, it produces a blank csv
Thanking you in advance.
Ann
I am currently designing a Sage report for importing as a csv to a courier app for international customs invoices and am looking for help with If, Then, Else Statements.
On Sage I have designated INVOICE.NOTES_2 as the 'cell' in which a 'Y' should be placed by the user if a customs invoice is required. If the cell has a 'Y' then a series of information needs to included in the csv, if not 'Y', then leave it blank or "". The expressions I have created are:
INVOICE.NOTES_2 in ("Y","y")? "Commercial" : ""
INVOICE.NOTES_2 in ("Y","y")? INVOICE.INVOICE_NUMBER : ""
SALES_DEL_ADDR.COUNTRY_CODE in("AU")? "N" : ""
INVOICE.NOTES_2 in ("Y","y")? "GB550187XXXXXX" : ""
INVOICE.NOTES_2 in ("Y","y")? "GB" : ""
INVOICE.NOTES_2 in ("Y","y")? "0.00" : ""
INVOICE.NOTES_2 in ("Y","y")? INVOICE.ANALYSIS_1 : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.VAT_REG_NUMBER : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.TELEPHONE : ""
INVOICE.NOTES_2 in ("Y","y")? SALES_DEL_ADDR.E_MAIL : ""
The problem is, whilst the expression is accepted, it produces a blank csv
Thanking you in advance.
Ann