CR has a function called Next. You can find an explanation in CR Help in the index section type Next. it will give the information you need.
Here is the sample from the help file
------------------
If Next({file.QTY})<>0 Then
{file.QTY}/2
Else
{file.QTY}
--------------------------------
Hope this helps.
Regards,
John W.