Trim string not working in array when multiple values

34 Views Asked by At

I have a Crystal Report with multiple arrays populated by formulas. Within these arrays I need to list the codes which come off of a formula based on a description. I.e. If "Denver" then "DIA" else if "Seattle" then "SEA". There can be multiple records that need complied. When I only have 1 record it works great, [DIA], however if there is more than one value the conversion [Denver, Seattle]. In my head I know this is because of the if/then situation since both are true. What is a better way to handle this scenario?

I have tried changing the formula to be an OR statement.

1

There are 1 best solutions below

2
MilletSoftware On

Try something like:

local stringvar Concatanated_Cities := Join(cities_array, ", ");
Concatanated_Cities := Replace(Concatanated_Cities, "Denver", "DIA");
Concatanated_Cities := Replace(Concatanated_Cities, "Seattle", "SEA");