Login / Register  search  syndication  about

          George Jensen's Blog

George Jensen on Reporting, Business Intelligence, Crystal Reports, Visual Analyzer, and more.

Working with Left and Right String Functions

Continuing on working with the functions in Business Objects Crystal Reports I thought we could look at the Left and Right functions.  I know to some of the readers this may be some simple stuff but remember I try to write to new users of Crystal and SalesLogix reporting.

When I think of working with these function the first thing that comes to my mind is the military.  While serving in the National Guard I have had the opportunity to use these functions in script in creating reports.  By regulation a Soldiers social security number is used as a unique identifier.  The military is trying to be smart and not throw this important id number on the many lists they deal with everyday so they often use what is called a laundry mark.  

A laundry mark is a combination of the soldiers first initial of the last name and the last four of the SSN.  To programmable call the laundry mark out of data we can use the Left and Right String functions.  For our example we will use the Sage SalesLogix Contact tables Last Name and Work Phone.  To display this data in Crystal we would create a formula field called Laundry Mark.  

When the Field Formula Workshop opens look for the Function Tree.  If the Function Tree is not displaying select the Alt and U keys.  Navigate to the String Value in the Function Tree and click on the plus sign next to it. 

 You can see the Left value in the list, the right is a little further down but the process is the same for each.

Left (str, length)

There are two parameters for these function, the first is the string.  If you are using a integer or double field type you would have to convert the field to a string.  Both of our fields are string fields.

The second parameter is the number of characters from the left you want to collect.  For lastname we only need first character but for the workphone we will use the last four characters.

Our formula for LaundryMark field would look something like.

Left(lastname, 1) & Right(workphone, 4)

The data will look something like this when inserted into your report.

J0214

We will go into the Conversion next.

Remember our list of free SalesLogix Reports

 

 

 

What's This?
  
Bookmark and Share

About George Jensen

   George Jensen is a Senior Developer for Customer FX Corporation.


Related Content
   How do you add a parameter for File Attachment Size and Timeout in Saleslogix 8.1?
Question: Is it possible to set a parameter for file attachment size and timeout in Salelogix? If
Posted on Aug 07, 2014 by Dale Richter to SalesLogix Questions & Answers
 
   Fixing Duplicate Saleslogix FieldIndex Values in the SECTABLEDEFS
I had to fix a client's SECTABLEDEFS table that contained duplicate FieldIndex values.  FieldInd
Posted on Aug 07, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix XBar Installation
When installing the new XBar application I found the instructions a little vague so I thought I would pas
Posted on Jul 18, 2014 by Mark Duthoy to SalesLogix Support
 
   Using an Array - SQL vs Crystal.
In data, an Array is used to store multiple values in a single variable.  I often use Arrays to qual
Posted on Jul 17, 2014 by George Jensen to George Jensen's Blog
 
   "Saleslogix’s affordable pricing and usability allow the product to rise above competitors in the space" - Info-Tech Research Group, Inc.
"SalesLogix’s affordable pricing and usability allow the product to rise above competitors in the sp
Posted on Jul 14, 2014 by Scott Weber to SalesLogix Product Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register