Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 2011 Replace Function

Status
Not open for further replies.

CSchilling

Technical User
Mar 25, 2014
3
Hello!
I need help! I created a formula that would appear as its own column in the report. In the formula I am telling it to replace several benefit plans to different text. For example, I have a Benefit Plan labeled HMNT1 and I want it to read HMO Member Only. I work in HR and we have several Benefit Plans that I wanted renamed to read a better description. Below is the formula I used in the Formula Editor. It only replaced the last row, not any of the others. Any assistance you can provide is appreciated.

(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "H+1ATU", "HMO M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDNT1", "Dental M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDNT2", "Dental M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDNT3", "Dental Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDT1", "Dental M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDT2", "Dental M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HDN3", "Dental Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HF-ATU", "HMO Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMNT1", "HMO M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMNT2", "HMO M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMNT3", "HMO Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMO+1U", "HMO + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMOATU", "HMO M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMOEOU", "HMO M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMOF-U", "HMO Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMT1", "HMO Employee Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMT2", "HMO M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HMT3", "HMO Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPNT1", "PPO M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPNT2", "PPO M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPNT3", "PPO Family"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPT1", "PPO M Only"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPT2", "PPO M + 1"));
(Replace ({PS_HEALTH_BENEFIT.BENEFIT_PLAN}, "HPT3", "PPO Family"));
 
I think a switch statement is probably closer to you want to accomplish unless the search text is only part of the text that is in the {PS_HEALTH_BENEFIT.BENEFIT_PLAN} field.

Example: switch({PS_HEALTH_BENEFIT.BENEFIT_PLAN}= "H+1ATU", "HMO M + 1",{PS_HEALTH_BENEFIT.BENEFIT_PLAN}= "HDNT1", "Dental M Only", and so forth.
 
You are a genius! Thank You. That worked like a charm and I know I can use it for other things.

Thank You!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top