NONEMPTY

NONEMPTY(recordsetlist)

recordsetlistA comma-delimited list of record sets.
Return:NONEMPTY returns a record set.

The NONEMPTY function returns the first record set from the recordsetlist that contains any records. This is similar to using the EXISTS function in an IF expression to return one of two possible record sets.

Example:

SalesRecord := RECORD
  INTEGER OrderNumber;
  INTEGER SaleAmount;
END;
Sales := DATASET([{923,1001},
                  {924,23},
                  {925,3000},
                  {926,3423},
                  {927,9999},
                  {931,113}], SalesRecord);
ds := NONEMPTY(Sales(SaleAmount>20000),
                 Sales(SaleAmount>10000),
                 Sales(SaleAmount>3000));
OUTPUT(ds);

See Also: EXISTS