Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Feb 20, 2017 at 05:35 PM

    Insert, CrossTab...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 21, 2017 at 06:03 PM

    Thank you Ido Millet !!! it worked :)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 22, 2017 at 04:03 PM

    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!!

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 22, 2017 at 05:06 PM

    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

    Add comment
    10|10000 characters needed characters exceeded