crystal reports formula field select row with minimum value

3.5k Views Asked by At

i have following data :

Name        Amount
================

Amit         18000
Ajay         19500
Bharat     16100

how do i print the name with lowest amount in the report footer.

i tried the following formula

if {table.amount} = minimum({table.amount}) then
'Lowest Vendor - ' + {table.name}

above formula returns a blank value.

I need this in Crystal Reports not in RDBMS.

1

There are 1 best solutions below

0
On BEST ANSWER

Take a local variable and store the value in that and use the variable in report footer.

    Shared Stringvar a;
Shared Stringvar b;
    a:=
    if {table.amount} = minimum({table.amount}) then
    'Lowest Vendor - ' + {table.name}
else '0';

if a<>'0'
then b:=a;

place this formula beside the amount column.

  1. Create another formula and write below formula and place it in footer

    Shared Stringvar b; b