Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Field manipulation Post Reply Post New Topic
Author Message
NedSchneebly
Newbie
Newbie


Joined: 09 Jul 2009
Location: Canada
Online Status: Offline
Posts: 23
Quote NedSchneebly Replybullet Topic: Field manipulation
     Posted: 09 Jul 2009 at 1:57pm
Hi all,

   I am brand new to CR (been at it for just days) and using CR XI. Normally I read the FAQ or past forum entries before asking a question, but since I'm not too familiar with the terminology yet, I am not even quite sure how to phrase this question. So if it has already been covered to death - sorry!

Situation: I am extracting a field out of a TrackIt Database called TASKS.PRIORITY. The values for it are "1-Major Incident", "2-High Incident", "3-Medium Incident", etc (they made the values that so it would come out sorted in TracKit pulldown menues - sort of like "AAA Plumbing" in the Yellow Pages").

When I group by PRIORITY and then make a pie chart (or whatever) based on that group, it automatically creates a legend for me and labels the pie chart with the PRIORITY values and totals (I asked for that), which is great. But it looks like this:  "20 3-High Incident", "17 4-Low Incident", etc. Kind of confusing to the reader, who probably doesn't want to see the actual label names. I want it to look like this: "20 High Incident", "17 Low Incident".

Question: Is there a way for me to edit/manipulate those labels? Something like "If PRIORITY.value = '2 - High Incident' then value is 'High Incident'?"

Hope that makes some kind of sense. Thanks!

Sigless and Bible Black
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jul 2009 at 3:17pm

Right Click on the Formula Fields and select NEW and call it "Value" (or whatever you want).

For your formula use:
mid({priority.value},5)
 
Use that formula field in your chart instread of the original db field.
You can also place it on your detail row to validate that it is trimming the field correctly
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Jul 2009 at 6:16am
Could also try
 
mid({priority.value},instr({priority.value},"-")+1)
 
which will return everything after the hypen, just in case it floats
IP IP Logged
NedSchneebly
Newbie
Newbie


Joined: 09 Jul 2009
Location: Canada
Online Status: Offline
Posts: 23
Quote NedSchneebly Replybullet Posted: 10 Jul 2009 at 9:29am

Thank you. These worked perfectly!

Sigless and Bible Black
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum