I need help in calculating the sum of a formula filed in crystal report. I have a formula filed '#ClosingBalQty' ,I want to calculate the 'sum({ClosingBalQty}).
As its a formula it return an error.Can any one tell me how to just get total of '#ClosingBalQty'
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.
SAP Crystal Formula Workshop detecting the error when I am trying to multiply two columns inside the SUM function. However, my logic is working absolutely fine in MS SQL. Following is my SQL Code:
select Sum(Qty * Type) from Movements
Where, type could be '1' or '-1'. I am using this statement to get the Balance. Following is my formula inside the crystal report formula shop which is giving an error:
SUM({MovementReport;1.Qty} * {MovementReport;1.Type})
Is there any other way to do it?
You have to create a separate formula field that multiplies the two columns:
{MovementReport;1.Qty} * {MovementReport;1.Type}
and then calculate the sum of that formula field:
SUM({#YourNewFormula})
I have values in database witch is a percentage values for example:
Per columns : 90,85,38,70,85
I select “Per” as the value to be shown in the bar chart
But when I run my crystal report all my bar display as 100%
It does not take the exact value of “Per”
How can I solve this problem?
If your column values are whole numbers then you should probably create a formula to calculate the fraction. Then you should be able to display as a percentage. Eg. {table.fieldname} * .01
I am one step away from finishing up a report in Crystal 2008. I have included a snapshot of the report below. For some reason I cannot get the formula in the yellow column to calculate correctly. I am trying to divide the value of Net A for each main data source/year into the yearly Total of Net A to get the % of Data for each Main Data Source. Net A is pulling from a field in access and the total of Net A is a running total based on a current Run Date using formula ({HNT_End_To_End_Data.REPT_YYMM} = cStr(currentdate,'yyMM') in the evaluate section of the running total and the field is reset on each change of Year.
The formula in the yellow column is currently ({HNT_End_To_End_Data.Net_A}/Sum ({HNT_End_To_End_Data.Net_A}))*100 and is showing values that are like it's doing NetA divided into the grand total of Net A of all 3 years (3,727,560/108,666,439) rather than the dividing into individual year (3,727,560/34,981,163). I'm attempting to get the formula to divide each Main Data Source for each year into the yearly Net A total.
I've tried doing many different formulas and have had no luck, so would appreciate any suggestions anyone might have.
Do you have a group on year({sometable.somedate})? You need to add that group into your aggregate (sum) function:
(
{HNT_End_To_End_Data.Net_A}
/
Sum({HNT_End_To_End_Data.Net_A}, year({sometable.somedate}))
) * 100
EDIT: After reviewing the report I can see you are using a conditional formula {HNT_End_To_End_Data.REPT_YYMM} <> cStr(currentdate,'yyMM') to suppress the detail section. So SUM({HNT_End_To_End_Data.Net_A},{HNT_End_To_End_Data.SERVICE_THRU_YEAR}) is actually including the records which aren't being displayed. You have a number of ways to get around this. The simplest is probably to create a new formula for net_a:
if {HNT_End_To_End_Data.REPT_YYMM} <> cStr(currentdate,'yyMM') then
{HNT_End_To_End_Data.Net_A}
else
0;
You can then do:
(
{HNT_End_To_End_Data.Net_A}
/
Sum({#net_a}, year({sometable.somedate}))
) * 100
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)).