Skip to Content
0

Crystal Reports need to find the max & minimum value for dynamic input

Feb 20, 2017 at 03:39 PM

98

avatar image

Hello,

Am trying to create a Crystal Report for showing minimum and maximum value of a field based on the input given to the report.

My Parent report has 2 input parameter: field 1 and field 2 (here user can select 'n' number of parameters as input to the report). These two values are passed into the Subreport query. The query results fetches me the matching rows from the DB. The display fields on the results are field 1,2,3, 4 and few more. Here i need to have a separate group for the field 1 and field 2 (input parameter), and inside each section of field 1 & 2 I should display the maximum and minimum value of field 3.

Example:

Field1 Field2 Field3

Apple Red 5

Orange Red 10

Apple Green 15

Orange Red 20

Banana Yellow 6

Banana Green 10

Orange Yellow 25

In my report, i should show like :

Apple : Max - 15 ; Min -5

Orange : Max - 25 , Min - 10

Banana : Max - 10, Min - 6

Red : Max- 20, Min - 5

Yellow: Max- 25, Min - 6

Green: Max-15, Min- 10

Am trying to store the input parameter in a formula field and input values are stored like (###,Apple,Orange,Banana) for field 1 and (####,Red,Green,Yellow) for field 2. How do i split these input value and find the maximum & minimum value of another field? I want to know how to write formula in formula field section.

Please let me know, if my above requirement is not clear.

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

4 Answers

Best Answer
Ido Millet Feb 20, 2017 at 05:35 PM
0

Insert, CrossTab...

Share
10 |10000 characters needed characters left characters exceeded
Kayalvizhi V Feb 21, 2017 at 06:03 PM
0

Thank you Ido Millet !!! it worked :)

Share
10 |10000 characters needed characters left characters exceeded
Kayalvizhi V Feb 22, 2017 at 04:03 PM
0

Hello,

I have one more query which is like an extension of my post. Now am able to get the maximum and minimum value based on field 1 and field 2 using Cross tab concept. Next I need to do few more calculation with this Maximum & Minimum value. For example, am trying to get the difference of Maximum & Minimum value for each section. How to save or get the value calculated in the cross tab? so that i can find the difference and use those value in my further calculation.

Please help!!

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Feb 22, 2017 at 05:06 PM
0

Please post that as a separate question per SCN's rules.

Also, please post a sample of the expected output so that it easier to suggest a formula.

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded