Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal by Alpha Character in a field

Status
Not open for further replies.

spiced

Technical User
Aug 21, 2001
26
US
I'm new to Crystal reports and am using V7. I am sorting by Component ID# which consists of an Alpha then digits or some other character. What I want to do is subtotal the Alpha characters.

Thanks,
Darrel L. Spicer
 
Create a formula field that isolates these characters, such as left({fieldname},5), or whatever it takes to extract these characters, then subtotal on the formula field. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
The ID numbers start with A and end with Z if there is a way for the formula to only use the Alpha and not the numbers for the subtotal without specifying each letter in a formula.
I would be able to use a select and use "Component ID" "is like" "A*" and it would select all the A's and the report design would give me a grand total.
 
Left({IDnumber},1) should do the trick. All the As will be in one group, all the Bs in the next, etc. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
OK what would be the best way to do this? I can't get the subtotal to work only grand total. Then where would I edit the formula?
 
You have a grand total, but not totals for As, totals for Bs, etc? Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
In the design window, right click on the field(s) you want subtotaled. Select insert, summary and choose the formula field you created - the left({IDnumber},1) formula - as your group by field, and it should be a sum operation. Thats it, you're done. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
"left({EMComponent ID},1)" I tried this and it shows up in the report just like its typed in. Ok lets start from scratch, what steps do I use to create a formula?
 
Insert, field object, formula field. Name the field and enter exactly as above, execpt dump the quotes. When you do that crystal takes the formula to be equal to that literal string and it will not calculate anything. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
left({Equipment.Component ID},1) Ok this will give me the first letter of each ID# but no subtotal.
 
Ok, the subtotal is step 2. In the design window, right click on the number you want subtotaled. Select "insert summary", make it a sum, and sum by the formula field you just created for the first letter of each ID.

Now you should have subtotals. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Thanks it's working now I just need to get the format done.
 
What do you need with formatting? Please let me know. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Just how the final arrangement is going to look. I know I will have other questions in the future, but right now I have a lot of other things that also have to get done.
Thanks again,
Darrel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top