Tags:
create new tag
view all tags

SID-02092: CALC inside nested search that is inside calc

Status: Answered Answered TWiki version: 6.0.1 Perl version:
Category: CategorySearch Server OS: Ubuntu 12.10 Last update: 10 years ago

Hello,

I manage to get this far. But, the CALC inside the nested SEARCH is not giving a proper result.

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

I have "escaped" everything that need to be escaped.

Anybody with an insight is greatly appreciated.

Thanks

-- Michael Severo - 2015-07-22

Discussion and Answer

I have not studied your complex code, but it looks like $LISTSIZE() is not escaped, thus gets handled by the outer CALCULATE. Try $dollarLISTSIZE() if you want to delay it for the innermost CALC.

-- Peter Thoeny - 2015-07-23

Hi Peter,

I 've tried your suggestion but it still giving me unwanted result.

-- Michael Severo - 2015-07-23

solved

The "comma" seems to break the query - notices that through trial and error.

I did 3 queries instead

  1. Search and SET hashes. // not in the table. with these I could use/combine other spreadsheet variables.
  2. Search and remove duplicates in result. // First col
  3. Repeat the first row search with a nested query the resulted to the topics the belong the results in first col. // Second col
  4. Repeat the Second col search and a result to get the hashes that matches the result from the second col. // Next col

and so on...

With that search above resulted in the datas being align horizontally and vertically accordingly and easy to manipulate . For now these will work.

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

-- Michael Severo - 2015-07-25

      Change status to:
ALERT! 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.
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

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2015-07-25 - MichaelSevero
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.