Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Adding Percentage to Sum of Extended Price Post Reply Post New Topic
Author Message
justingibson
Newbie
Newbie


Joined: 29 Sep 2009
Location: United States
Online Status: Offline
Posts: 5
Quote justingibson Replybullet Topic: Adding Percentage to Sum of Extended Price
    Posted: 29 Sep 2009 at 9:49am
Hello, I'm trying to add a percentage to a sum of the extended price on a custom invoice. The report works fine without the custom adder. I added the formula below the sum of extended price and successfully managed to create a formula that adds the desired percantage (1.5%), but it's only giving it for the last extended price line, not the sum of extended price (all line items). I am a complete novice at Crystal Reports, I am merely altering a report that someone else in our company made a while back (he no longer works here...). Below is the formula I have added (but it's incorrectly only formulating 1.5% of the last line item, not the sum of all line items):
 
{Beacon_Invoice_Info.extended_price} * 0.015
 
I have tried things like adding sum of but nothing seems to work. I know it's gotta be something simple that is wrong. If I can give you any more information that would be helpful please let me know. Like I said, if I take the line out the report works beautifully but I need this new version of the report to add 1.5% before the tax to every whole invoice. Thanks in advance!


Edited by justingibson - 29 Sep 2009 at 9:50am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2009 at 10:20am
You need to multiply the sum but it depends on if this is a sum of all records (place on report footer)
SUM({Beacon_Invoice_Info.extended_price}) * 0.015
 
or the sum of a group (placed on group footer)
SUM({Beacon_Invoice_Info.extended_price},grouped field here) * 0.015
IP IP Logged
justingibson
Newbie
Newbie


Joined: 29 Sep 2009
Location: United States
Online Status: Offline
Posts: 5
Quote justingibson Replybullet Posted: 29 Sep 2009 at 10:50am
Using
 
SUM({Beacon_Invoice_Info.extended_price}) * 0.015
 
worked. However, how do I now get the grand total (which would be sum of extended_price + the new 1.5% adder + freight + tax_amount? Right now it uses total_amount which is all those things without the 1.5% adder. I tried creating a new formula
 
SUM({Beacon_Invoice_Info.extended_price},{Beacon_Invoice_Info.tax_amount},{Beacon_Invoice_Info.freight},{@Adder})
 
but it doesn't like the adder (the name of the 1.5% formula. Thanks so much for your help.


Edited by justingibson - 29 Sep 2009 at 10:51am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2009 at 11:13am
Depends on how you got the Freight and tax totals.
If you used formula fields then you can just create a new formula field adding the other 3 togther
{@formula 1} + {@formula 2} + {@formula 3}
or if not you add the SUMS togther
SUM(field1) + SUM(field2) + SUm(field3)
IP IP Logged
justingibson
Newbie
Newbie


Joined: 29 Sep 2009
Location: United States
Online Status: Offline
Posts: 5
Quote justingibson Replybullet Posted: 29 Sep 2009 at 11:25am

All are fields except the adder. But I need to add the 3 fields with the 1 formula, how do I do that? I tried

 
SUM(Beacon_Invoice_Info.extended_price) + SUM(Beacon_Invoice_Info.freight) + SUM(Beacon_Invoice_Info.tax_amount) + SUM(@Adder)
 
but that didn't work. Right now there is a field that's called Beacon_Invoice_Info.total_amount that is the result of all three fields (no adder) added together. However, since it's a field and not a formula I can't seem to edit it. I basically need total_amount + @adder.


Edited by justingibson - 29 Sep 2009 at 11:25am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2009 at 11:30am

Sorry have a little trouble following the set up.

If it is one field for all records then you can create a new formula to add it to the new adder formula ( i assume the adder formula is the one you created from the first posting question which already has a SUM in it. FYI-you cannot SUM a SUM).
{Beacon_Invoice_Info.total_amount} + {@(@Adder}
 
Is that what you need?
IP IP Logged
justingibson
Newbie
Newbie


Joined: 29 Sep 2009
Location: United States
Online Status: Offline
Posts: 5
Quote justingibson Replybullet Posted: 29 Sep 2009 at 11:36am
That is exactly what I need but it didn't seem to work. It doesn't like {@(@Adder}. This would be a second formula, correct? I need one to show the 1.5% (currently this is the @Adder) and a second formula to get {Beacon_Invoice_Info.total_amount} + {@(@Adder}.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2009 at 11:38am

OOps sorry. I copied and pasted that and it messed up:

{Beacon_Invoice_Info.total_amount} + {@Adder}


Edited by DBlank - 29 Sep 2009 at 11:38am
IP IP Logged
justingibson
Newbie
Newbie


Joined: 29 Sep 2009
Location: United States
Online Status: Offline
Posts: 5
Quote justingibson Replybullet Posted: 29 Sep 2009 at 12:09pm
That worked perfectly! You have no idea how big of a help you've been. Thank you so much!
 
-Justin
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.