Question
Guys, I bet this is a very simple task to do. But I'm just unable to find out a nice way of doing it.
I'm using
FormattedSearch to print the results in table. The
$rev
variable is used to print the revision. In support web,
$rev
reduced by
1
gives the number of answers to a question asked. How do I do
$rev-1
in a formatted search?
Environment
--
TWikiGuest - 28 Dec 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Assuming you've got the
SpreadSheetPlugin installed, you can write
%CALC{$EVAL($rev-1)}%
. To use this inside a
%SEARCH%
statement, you have to escape the percentage signs:
$percntCALC{$EVAL($rev-1)}$percnt
--
MartinKaufmann - 28 Dec 2007
Martin, thanks a lot for the response.
%CALC($EVAL(a-b))
works fine outside search. But inside search,
$percntCALC{$EVAL($rev-1)}$percnt
it is not working out. I even tried escaping the
$
of
EVAL
. But it is not working as expected.
--
TWikiGuest - 31 Dec 2007
Let's try this out:
topic:
SubtractingValues, rev: 6, rev-1: 5
It works as expected.
--
PeterThoeny - 31 Dec 2007
Yep.. it does work. I made a small syntax error in some other portion of the search query & that affected the formula. Thanks a lot for the response guys.
--
TWikiGuest - 02 Jan 2008