addFormula (QueryResultsProcessor - Java)

Provides Domino formula language to override the data used to generate values for a particular sort column and an input collection or set of collections. Since input collections can be created from different databases, design differences can be adjusted using addFormula to have homogenous values in the output.

Defined in



public void addFormula(String formula, String columnname, String referencename)
   throws NotesException


String formula

Formula language string to be evaluated in order to supply the values for a sort column.

String columnname

String value responding the programmatic name of the sort column whose values are to be generated using the formula language supplied.

String referencename

Used to specify the input collection names to which will use the formula language to generate sort column values. Wildcards may be specified to map to multiple input collection names.


QueryResultsProcessor qrp = dbb.createQueryResultsProcessor ();
// case 1. overrides values for sales_person column in coll2
qrp.addFormula(“@lowercase(sales_first + \” \” + sales_last),
“sales_person”, “coll2”); 
// overrides values for sales_person column in coll1
qrp.addFormula(“@lowercase(sales_person)”, “sales_person”, “coll1”); 
// overrides values for ordno_adjusted column for collection names matching coll*
qrp.addFormula(“ordno + 10000”, “ordno_adjusted”, “coll*”); 

// case 2. override column names against the categorized, aggregate case described in addColumn:
// supplies a 5% raise for across a categorized set of results
qrp.addFormula(“salary*1.05”, “salwithraise”, “coll*”); 
// constucts the fullname value from 2 other fields
qrp.addFormula(“firstname + “ “ + lastname”, “Fullname”, “coll*”);