Skip to Content
0

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

May 22, 2017 at 03:18 PM

91

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ian Waterman May 22, 2017 at 03:59 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0