Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed TopK documentation of parameter descending

...

  • scoringFunction [Expression]: An expression that must return a numerical value
  • k [Integer]: Number of elements that should be treated
  • descending [Boolean]: The standardcase is that the higher the score, the higher the rank. Set to false if the lower higher the score, the lower the rank.

Example:

Code Block
languagepqljs
PARSER PQL
#ADDQUERY
out = TOPK({
          k = 10,
          scoringfunction = 'price'                        
        },
        ELEMENTWINDOW({
            size = 5                              
          },
          bid
        )                  
      )
      
      
out2 = MAP({
            expressions = [
#LOOP i 0 upto 9
              ['elementAt(topk[${i}],1)','top_${i+1}_auction'],
              ['elementAt(topk[0],2)','top_${i+1}_bidder'],
              ['elementAt(topk[0],4)','top_${i+1}_price'],
#ENDLOOP,
              'topk'
            ], 
                ALLOWNULL = true, 
                SUPPRESSERRORS = true         
          },
          out
        )