question

tomashley avatar image
tomashley asked

Help writing a replace expression

Hi Guys, Can you help with following expression it doesn't seem to work when i combine them together? UPPER(TRIM( [ShipmentInformationServiceType] )) == "Express Saver" ? "UPS Worldwide Saver" : UPPER(TRIM( [ShipmentInformationServiceType] )) UPPER(TRIM( [ShipmentInformationServiceType] )) == "Standard" ? "UPS Standard" : UPPER(TRIM( [ShipmentInformationServiceType] )) UPPER(TRIM( [ShipmentInformationServiceType] )) == "Express" ? "UPS Worldwide Express" : UPPER(TRIM( [ShipmentInformationServiceType] )) Thanks, Tom
queryreplacederived-column
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Pavel Pawlowski avatar image
Pavel Pawlowski answered
The combined expression in derived column should look like UPPER(TRIM([ShipmentInformationServiceType])) == "EXPRESS SAVER" ? "UPS Worldwide Saver" : ( UPPER(TRIM([ShipmentInformationServiceType])) == "STANDARD" ? "UPS Standard" : (UPPER(TRIM([ShipmentInformationServiceType])) == "EXPRESS" ? "UPS Worldwide Express" : UPPER(TRIM([ShipmentInformationServiceType])) ) ) Anyway if you do an UPPER, you have to compare the value to UpperCase string e.g. `'EXPRESS SAVER'` otherwise it will never match.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.