Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Formula

Posted on 2014-04-17
5
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 23

Assisted Solution

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

Accepted Solution

by:
mlmcc earned 1200 total points
ID: 40007525
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 101

Expert Comment

by:mlmcc
ID: 40009467
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
ID: 40017669
How can I rearrange the points
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

609 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