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
Need more, need help now? we offer pay-as-you-go support, no contract, tenth of an hour billing, expert help, fast service, no call queue
We can offer lower cost Sage50cloud subscriptions for customer using pay-as-you-go support or who are self-supporting.
Need integration, your shipping system, your website, your invoicing system, your crm.
Need a bespoke solution, Mini Manufacturing, Spreadsheet order import, Back to back orders.
Want web hosting, email, your own domain name, a shop, we do it all!
We can offer lower cost Sage50cloud subscriptions for customer using pay-as-you-go support or who are self-supporting.
Need integration, your shipping system, your website, your invoicing system, your crm.
Need a bespoke solution, Mini Manufacturing, Spreadsheet order import, Back to back orders.
Want web hosting, email, your own domain name, a shop, we do it all!
If Statement not working
- brucedenney
- Site Admin
- Posts: 4331
- Joined: 28 Feb 2006, 09:56
- Sage Version: v2017 23 UK/Europe/Africa
Re: If Statement not working
I can't check right now because I am away from my desk, but I think the issue could be the value yo are comparing to "1" is a bit of Text whereas 1 is a number.
Try this
If it doesn't work let me know, I will be able to access sage later and can put your expression into the report designer and check it properly.
Try this
Code: Select all
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" : ""
For just about anything Sage :- switch to subscription, pay-as-you-go support, sagecover, upgrades, application integration, reports, layouts, analysis or any other help making life with sage easier/less time consuming Contact me. 

Re: If Statement not working
Hi Bruce,
That's worked! I'm really sorry, I'm sure I'd tried that too!
Thank you for your help.
That's worked! I'm really sorry, I'm sure I'd tried that too!
Thank you for your help.
Who is online
Users browsing this forum: No registered users and 1 guest