I have a sum I want to basically copy the text but not calculate the formula.
Sum formula:
if next ({field}) > 0 then next ({field}) - {field2}
Formula works fine, I need to duplicate/copy the Sum ##, but I don't want the formula.
I've tried Totext, CSTR, true/false etc... everything copies the sum formula.
I just need something like "sum" and no formula.
I figured it out
abs (if next ({field}) > 0 then next ({field}) - {field2})
Related
Im new to Crystal report. Would appreciate for your help and advice.
I have applied the 1st formula add into the crystal report and trying to sum it if the value is only 1. Attempted to create 2nd formula but having the error.
Formula: test3
if(Count ({CUSTINVOICEJOUR.INVOICEID}, {CUSTINVOICEJOUR.INVOICEID})) = 2 then 1 else 0
sum ({#Test3})
error - this field cannot be summarized
Crystal cannot total formulas that depend on totals.
You can define a numeric variable and increment it in a GF formula using the same conditional logic. Then, display the resulting total in a formula below the "action".
You didn't describe what level of aggregation you are after (grand total across level 1 subtotals? Level 1 total across level-2 subtotals?) so it's difficult to refer to appropriate level of "action" in more concrete terms.
I need your help, how can I know the total(sum) in a field that is itself the joining of two formulas:
Main formula:
sum(#weight)
Formula 1:
#open = if ({OrderRel.OurReqQty}
- (Sum ({ShipDtl.OurInventoryShipQty}, {OrderRel.OrderRelNum}))
- (Sum({ShipDtl.OurJobShipQty}, {OrderRel.OrderRelNum}))) < 0 then 0
else
{OrderRel.OurReqQty}
- (Sum ({ShipDtl.OurInventoryShipQty}, {OrderRel.OrderRelNum}))
- (Sum({ShipDtl.OurJobShipQty}, {OrderRel.OrderRelNum}))
Formula 2:
#weight = {#open}*{Part.NetWeight}
I can't calculate the sum field by referring the #open and #weight formulas.
You can't calculate the sum by just using sum function, Instead you may use running total or write a formula to calculate sum of the weight function like sum one by one for each group and then reset it at start of the group
Make a third formula that uses the logic {#open} + {#weight}. This will get the sum of the two values per record.
If you're looking for a grand total of every instance of Open and Weight on the report, use the new formula as the field to summarize a Running Total. Set the Type of Summary to sum, evaluate for each record, and reset never.
How do I get a crosstab in Crystal Reports 2013 to exclude null values from a crosstab average?
For example
Procedure Name : OCT RETINA
Procedure Count : 8
Procedures with Completion Times Populated : 6
Summary of all 6 Completion Times : 101
I was expecting the average of the Completion Times to be calculated as 101/6. Instead, Crystal Reports is calculating the average as 101/8. It needs to be calculated as 101/6 (without counting null values in the denominator).
Adding another group is not an option because of the very specific way the values are sorted in the detail (hence a crosstab in a footer). The names of the procedures are dynamic so keeping a running total of each procedure's average completion time is not an option either.
Thanks in advance!!!!
One solution would be instead of taking the field create a formula use that in cross tab.
Create a formula #count
if << procedure field>>=<<your value>>
then 1
else 0
Now place the formula and take sum instead of count
Thanks for everyone's feedback! The answer is to use Weighted Average instead of just a plain old Average.
All I had to do was
a. Create a formula field called IncludeProcInDenominator and set the value to
if {Command.ProcTime} > 0 then 1
b. Right click on the Average Proc Time calculation in the crosstab and select Edit Summary
c. When the Edit Summary dialog box appears, in the Calculate This Summary drop down, select Weighted average with
d. In the dropdown box underneath that, select #IncludeProcInDenominator
In effect, the only values that are averaged are the ones where #IncludeProcInDenominator = 1
Thanks for everyone's help!
I am trying to sum two different formula fields in Crystal. It will not let me select them from the Sum. The first formula is
if Sum ({tblPostedLine.pli_QUANTITY_SHIPPED}) >= 1
then {tblPostedLine.pli_NET_PRICE}
else ({tblPostedLine.pli_NET_PRICE} * -1)
I am trying to take a price and make it a negative value if the quantity is a negative value. I then want to sum the amounts to get a net amount that was shipped.
The other formula is
If PreviousIsNull({RodsvwCatalogAnalysis.pro_PROMOTION_CODE})
or ({RodsvwCatalogAnalysis.pro_PROMOTION_CODE}) <>
Previous({RodsvwCatalogAnalysis.pro_PROMOTION_CODE})
then {RodsvwCatalogAnalysis.pit_AREA_PER_PAGE} else 0
With this formula, I am trying to sum at a group level, not the details level. When I just sum the group level number, it is adding it every time the value is listed in the details as well.
I am open to any suggestions.
Thanks!
For the first scenario,
Create 1 variable formula in detail level to hold with your requirement.
for e.g.
#NetPrice , formula if {tblPostedLine.pli_QUANTITY_SHIPPED} >= 1 then
{tblPostedLine.pli_NET_PRICE} else ({tblPostedLine.pli_NET_PRICE} * -1)
using running total field feature in your Field Explorer to sum up the value and place
your group footer.
For the second scenario, I believe it relate to promotion group and again you could use the running total field feature to evaluate the sum condition and reset the value when condition are meet like field value change.
I did a summation in one formula say Formula1. Now i created Formula2 which would do summation of Formula1 as Sum({#Formula1}).
But the crystal report gives the error as "The Field could not be summarized". I understand that summation of sum cannot be done, but i need to do this as Formula1 does summation of columns i.e. brings up Total and Formula2 brings up grand Total.
Please Help!
thanks
Does your Formula1 always evaluate to a numeric value? For example, if you designed Formula1 to display "-" instead of "0", that would cause the problem for Formula2.
If this is a simple summation, you don't even need a Formula2. Crystal has a built-in alternative. On Formula1, go to right-click->Insert->Summary and choose where you want it (Group Footer or Report Footer)
If you copy your summation field and paste it in the Report Footer, it will calculate a grand total--no need to do a sum(sum(field)).