$ 0 0 display of udf attached . there are only four line items but getting so many values of N and Y from udf . there should be first 4 . first line item Y and remaining N . again it it looping looks like