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?
- - - - - - - - - - - - - - - - - - pay-as-you-go support - no contract - tenth of an hour billing - expert help - fast service - no call queues
Need integration?
- - - - - - - - - - - - - - - - - - with your shipping system - website - invoicing system - crm - cms - manufacturing - order import - back to back orders..
Need a report?
- - - - - - - - - - - - - - - - - - Excel reporting that pulls data from Sage - custom layouts - layouts that change adapt to your brands and/or for drop shipping.
Want web hosting?
- - - - - - - - - - - - - - - - - - Your own domain name - email - a shop - wordpress - woo commerce - ticket systems - help desks - forums - portals
- - - - - - - - - - - - - - - - - - pay-as-you-go support - no contract - tenth of an hour billing - expert help - fast service - no call queues
Need integration?
- - - - - - - - - - - - - - - - - - with your shipping system - website - invoicing system - crm - cms - manufacturing - order import - back to back orders..
Need a report?
- - - - - - - - - - - - - - - - - - Excel reporting that pulls data from Sage - custom layouts - layouts that change adapt to your brands and/or for drop shipping.
Want web hosting?
- - - - - - - - - - - - - - - - - - Your own domain name - email - a shop - wordpress - woo commerce - ticket systems - help desks - forums - portals
If Statement not working
- brucedenney
- Site Admin
- Posts: 4631
- Joined: 28 Feb 2006, 09:56
- Sage Version: v28 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 :- Discount subscriptions, pay-as-you-go support, application integration, reports, layouts, linked excel spreadsheets, 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 0 guests