cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the maximum value of a formula field since 'it cannot be summarized'?

Former Member
0 Kudos

Hi everyone!

I am quite new to Crystal Reports. I have a question regarding formula fields:

How can I get the maximum value of a formula field since 'it cannot be summarized'?

I looked on many forums but I don't find any successful answer, hopefully someone here will help me find a solution!

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You will need to use a variable

assuming you may want to reset use 3 formula,

@reset// place this in group header where max is being determined and suppress

Whileprintingrecords;

Global Numbervar maxval:=0

@Eval // Place this in group footer where max is being evaluated/displayed and suppress

Whileprintingrecords;

Global Numbervar maxval;

If sum(valuefield, groupfield) > maxval then maxval:= sum(valuefield, groupfield) // replace valuefield and groupfiled with your respective field names

@display place this where you want to see the max of summarised field

Whileprintingrecords;

Global Numbervar maxval;

Ian

Former Member
0 Kudos

Thank you Ian for taking the time to provide an answer.

Yet, I cannot apply the sum() function to a formula field I created, that is my problem, I get the following error message:

This is why I need a 'workaround' to solve this issue.

Thanks

Mounia

Former Member
0 Kudos

replace this bit of the eval formula with your formula.

the variable will then find the max of that.

Alternatively post your formula and an indication of report structure, showing where formula is being evaluated and which group needs to show max of that formula

Ian

Answers (0)