| Status: | |
TWiki version: | 6.0.1 | Perl version: | |
| Category: | CategorySearch | Server OS: | Ubuntu 12.10 | Last update: | 10 years ago |
the query
%CALCULATE{$LISTJOIN($n, $LISTEACH(|$index.|[[Name.$item][$NOP(%)FORMFIELD{"Title" topic="Name.$item"}$NOP(%)]] | $NOP(%)SEARCH{"Belongsto='$item' AND State='Open' AND Ewotype='Sale'" type="query" web="Activity" sort="formfield(Priority)" reverse="off" nonoise="on" separator="%BR%" format="$percntSEARCH{$quotBelongsto=$aquot$topic$aquot AND Topicclassification=$aquotActivity$aquot AND NOT State=$aquotClosed$aquot$quot type=$quotquery$quot web=$quotActivity$quot nonoise=$quoton$quot separator=$quot,$quot
format=$quot$dollarpercntCALC{$LISTSIZE($dollartopic)}$dollarpercnt$quot }$percnt"}$NOP(%) |,$LISTSORT($LISTUNIQUE(%ACTIVE_NAME%))))}%
result
| "active_name" | 1,1 |
expected result
| "active_name" | 2 |
$LISTSIZE() is not escaped, thus gets handled by the outer CALCULATE. Try $dollarLISTSIZE() if you want to delay it for the innermost CALC.
-- solved
The "comma" seems to break the query - notices that through trial and error.
I did 3 queries instead
e.g.
| # | Prospect | work order | lead time | Due | Activity |
|---|---|---|---|---|---|
| 1. | John Adams | •SO-0001 "topic status update if exist" |
1d 1h | Fri July 31 | 2 |
| 2. | John Doe | •SO-0010 •SO-0015 "need to win these" |
1d 1h 3d 3h |
Sat July 25 Fri July 31 |
0 4 |
| 3. | Zebra inc | •SO-00010 | 1d 1h | Mon Aug 3 | 2 |
| SupportForm | |
|---|---|
| Status | Answered |
| Title | CALC inside nested search that is inside calc |
| SupportCategory | CategorySearch |
| TWiki version | 6.0.1 |
| Server OS | Ubuntu 12.10 |
| Web server | Apache |
| Perl version | |
| Browser & version | |