Q:

Crystal Reports - Selecting data in the first row to be used in a formula

I have a very basic report with no groups.  The details consists of a number of numeric columns.  I want to add a formula field which will use a field from the first row. Example:
(ColumnAFromCurrentRecord - ColumnBFromFirstRecord) / ColumnBFromFirstRecord
Can someone point me in the right direction? 

A:

you need to extact the column b from first record. try below solution.
Note: This is not a tested solution as I at present I don't have CR.

create below formula Count and place in detail section:
Local NumberVar a;
a:=a+1;

This will number the rows starting from 1 to the last row.
Now create one more formula StoreB:
Share NumberVar b;

if {@Count}=1
then b:=columnb

This will store the value of columnb in first record in variable b
Now use where you want:
EvaluateAfter(@StoreB)
Shared NumberVar b;

(ColumnAFromCurrentRecord - b) / b

Let me know how it goes.

