views:

61

answers:

2

I have a list of numbers and I want to somehow know if there is a number missing.

+2  A: 

Not a lot of information to go on, but going by two definitions of "missing", consider using Crystal's conditional formatting:

a. If "missing" means empty or null, check for that, and flag the outputted field with color and/or replacement text.

b. If "missing" means a number in a series isn't there, you'll have to create a running total or similar to fit the series, then compare that to what your data is returning. When they don't match up, that's when you flag the missing number.

David LaRocque
+1 for making an answer out of thin air
dotjoe
+1  A: 

Assuming this is a consecutive list of numbers (ie 1,2,3,4, etc) and you're looking for gaps, add a formula like this (Crystal Syntax) :

If Not (PreviousIsNull({Table.NumberField})) Then
    (Previous({Table.NumberField}) <> {Table.NumberField} - 1)
Else
    False

This will return True if the current row is not one more than the previous row.

Otherwise, one of David's solutions is more suitable.

CodeByMoonlight