Motivation
This would facilitate the creation of a view (i.e. formatted search) that would select topics based on fields already calculated.
For example, in a form, it would be possible to have a field to store the difference between two dates, such as
DateRequested and
DateResolved, in
DateDiff. It would then be possible to do a formatted search selecting docs with
DateDiff > n, without recurring to spreadsheet calcs that repeat the calculation.
Description and Documentation
In form definition, add an additional column, 'Calculate Value', such that, if value contains a variable name, like %MYFIELD%, Twiki stores the resultant value instead of the formula.
See also:
http://twiki.org/cgi-bin/view/Support/ChangeFormValueViaCalculation
Examples
Impact and Available Solutions
Implementation
--
Contributors: RalphEllison
Discussion
There are many questions on such feature. E.g., what if you change the value of one of the fields. Does the formula get recalculated? But if I had stored the value of the formula rather than the formula, where does the re-calculation come from?
If you want the value of a calculation to be stored in a form field rather than the formula, you can do so on topic creation, as variables in form fields are expanded on topic creation unless they are protected. (I.e., in the form, use the formula as the value for the field. When the topic is created with this form attached, the value of the formula will be substituted for the formula.)
For anything beyond, requirements will have to be written very carefully....
--
ThomasWeigert - 16 Jan 2007
Somewhat related / food for thought:
HowToStoreSearchResultsInAVariable.
--
PeterThoeny - 17 Jan 2007