If Statement not working
Posted: 19 Oct 2020, 10:10
Hi,
I have created a report to show customer discounts, which shows the Sales_Ledger_Discount_Type, but when I run the reports it shows the coded variable numbers 0 to 6, and I want it to show on the report as 'Discount A, B C etc.'
I have tried the following If Statement, within the Expression Editor of the Sales_Ledger_Discount_Type box, but it doesn't work. Could you let me know what I'm doing wrong?
SALES_LEDGER.DISCOUNT_TYPE = "0" ? "No Additional" : SALES_LEDGER.DISCOUNT_TYPE = "1" ? "Invoice Value" : SALES_LEDGER.DISCOUNT_TYPE = "2" ? "Discount A" : SALES_LEDGER.DISCOUNT_TYPE = "3" ? "Discount B" : SALES_LEDGER.DISCOUNT_TYPE = "4" ? "Discount C" : SALES_LEDGER.DISCOUNT_TYPE = "5" ? "Discount D" : SALES_LEDGER.DISCOUNT_TYPE = "6" ? "Discount E" : ""
Thank you
I have created a report to show customer discounts, which shows the Sales_Ledger_Discount_Type, but when I run the reports it shows the coded variable numbers 0 to 6, and I want it to show on the report as 'Discount A, B C etc.'
I have tried the following If Statement, within the Expression Editor of the Sales_Ledger_Discount_Type box, but it doesn't work. Could you let me know what I'm doing wrong?
SALES_LEDGER.DISCOUNT_TYPE = "0" ? "No Additional" : SALES_LEDGER.DISCOUNT_TYPE = "1" ? "Invoice Value" : SALES_LEDGER.DISCOUNT_TYPE = "2" ? "Discount A" : SALES_LEDGER.DISCOUNT_TYPE = "3" ? "Discount B" : SALES_LEDGER.DISCOUNT_TYPE = "4" ? "Discount C" : SALES_LEDGER.DISCOUNT_TYPE = "5" ? "Discount D" : SALES_LEDGER.DISCOUNT_TYPE = "6" ? "Discount E" : ""
Thank you