Print Page | Close Window

field delimited with semicolons

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7892
Printed Date: 28 Apr 2024 at 12:23pm


Topic: field delimited with semicolons
Posted By: elie234
Subject: field delimited with semicolons
Date Posted: 02 Oct 2009 at 11:21am
I am dealing with a table that holds a field for the opening balance of an account at the start of a year and then in a semi colon delimited field lists the period balance (i.e. net change) of that account for each month of the year. On the report I would like to display the current balance for the account which would mean I would have to sum up all of the values in the semi colon delimited field and add the sum to the opening balance.
My question then is how to parse the field to separate out each of these period balance values. Thanks for any help.



Replies:
Posted By: FrnhtGLI
Date Posted: 02 Oct 2009 at 11:40am
13 formulas:
 
split({periodbalance}, ';')[1]
 
for January on through [12] for December (if that's how they're split).
 
Last formula to add the 12 fields and the opening balance. That's how I would do it, may be an easier way, may not. Give it a shot.
 
 
EDIT:
 
I haven't tried this but you may be able to just make one formula:
 
split({periodbalance}, ';')[1]
+
split({periodbalance}, ';')[2]
+......
+
{openingbalance}
 
 
I've never tried it but would be interrested to see if it works.
 
 


Posted By: elie234
Date Posted: 09 Oct 2009 at 12:01pm
Thanks! The single formula worked.



Print Page | Close Window