Solved

Crystal Formula

Posted on 2014-04-17
5
214 Views
Last Modified: 2014-04-23
Is there a way to parse a data like
20|3.5|30|20|3.5|
and display the first number 20 and then add and show the rest  which is 3.5+30+20+3.5 = 57
The data is random sometimes like 44|20|20|36|
it keeps varying but the basic idea is to display the first number and add up the others and show.
Please help.
0
Comment
Question by:Star79
  • 2
5 Comments
 
LVL 22

Assisted Solution

by:Ido Millet
Ido Millet earned 200 total points
Comment Utility
See Split() function in Crystal's online help.  It would give you an array, and you can then loop through it.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 300 total points
Comment Utility
What do you want displayed?

Building on Ido's idea

To display the first number

Split({YourField},'|')[1]

Open in new window


To sum the remaining
Local StringVar Array myNumbers;
Local Number Var Total;
Local NumberVar Index;

myNumbers := Split({YourField},'|');
Total := 0;
For Index := 2 to UBound(myNumbers) do
    Total := Total + Val(myNumbers[Index]);
Total

Open in new window


mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Ido's comment should have received some of the points.  I don't know if I would have come up with the SPLIT function immediately as the solution

mlmcc
0
 

Author Comment

by:Star79
Comment Utility
How can I rearrange the points
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now