cancel
Showing results for 
Search instead for 
Did you mean: 

Rename data if.....allowing me to group up....

Former Member
0 Kudos

Post Author: Stuart

CA Forum: Formula

Dear All, I have been creating some useful reports in crystal but I can't seem to work out how to do the following. I need a statement that can do two things, If data in field 1 is equal to "100100" and data in field 2 begins with Name1 then rename "Name1" to "Name2". Essentially my data has long names and I just want to be able to group in certain ways. The above will really help me achieve this. I have tried a formula to do this but I was unsuccessful. Hope someone can assist, Many thanks, Stuart

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Post Author: Stuart

CA Forum: Formula

This worked great

Many thanks

Former Member
0 Kudos

Post Author: amr_foci

CA Forum: Formula

if({Tab.NAME} like "Name1" ) then "GroupA" else

if({Tab.NAME} like "Name2" ) then "GroupB" else

if({Tab.NAME} like "Name3" ) then "GroupC" else if({Tab.NAME} like "Name4" ) then "GroupD" else {Tab.NAME}

its "else" not "or"

good luck

Former Member
0 Kudos

Post Author: Stuart

CA Forum: Formula

Hi

I am trying to amend your forumla to get this working;

if({Tab.NAME} like "Name1" ) then "GroupA" or if({Tab.NAME} like "Name2" ) then "GroupB" or if({Tab.NAME} like "Name3" ) then "GroupC" or if({Tab.NAME} like "Name4" ) then "GroupD" orelse {Tab.NAME}

I get the error "A boolean is required"

Hope you can help.

Also how can I manipulate the above code to enter the "GroupA" in a completely seperate field and leave the data in NAME the same. I could then use thiis new field to group.

Many thanks,

Stuart

Former Member
0 Kudos

Post Author: Stuart

CA Forum: Formula

Hi

I am trying to amend your forumla to get this working;

if({Tab.NAME} like "Name1" ) then "GroupA" or if({Tab.NAME} like "Name2" ) then "GroupB" or if({Tab.NAME} like "Name3" ) then "GroupC" or if({Tab.NAME} like "Name4" ) then "GroupD" orelse {Tab.NAME}

I get the error "A boolean is required"

Hope you can help.

Also how can I manipulate the above code to enter the "GroupA" in a completely seperate field and leave the data in NAME the same. I could then use thiis new field to group.

Many thanks,

Stuart

Former Member
0 Kudos

Post Author: Stuart

CA Forum: Formula

Thanks to both of you,

I'll give this a try.

Much appreciated,

Stuart

Former Member
0 Kudos

Post Author: amr_foci

CA Forum: Formula

this is may wat you want

if({TAB.FIELD1}=100100 and {TAB.NAME} like "text" ) then"text"else {TAB.NAME}

you can replace this "text" with any other values like {TAB.NAME2} , and you can check the help for "like" operator

good luck

Former Member
0 Kudos

Post Author: amr_foci

CA Forum: Formula

if({TAB.FIELD1}=100100 and InStr ({TAB.NAME},"text" )=1 ) then"text"else {TAB.NAME}

try this, and i will find out any other solution