Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Applies to:  

Status
colourGreen
titleCelonis 4.2
 
Status
colourGreen
titleCelonis 4.3
 
Status
colourGreen
titleCelonis 4.4
 

Description

Transfer columns in groups to the R server. On each group the R-Script is applied and one result is expected.

Syntax


Code Block
languagetext
themeDJango
RAGG(table.column AS input_name(, table.column AS input_name)*, r_script)


  • table.column: Column(s) to be transferred to the R server
  • input_name: Name under which the column will be accessible in the R script
  • r_script: R script to be called


RAGG is an aggregation. It splits the input in groups and calls for each group the R script. The R script has to aggregate the group and return a single value.

Examples


Execute RAGG to calculate the correlation of the example data from LINEAR_REGRESSION


Panel
titleQuery
Column1


Code Block
languagetext
themeDJango
RAGG( "Table1"."Month" AS MONTH, "Table1"."Income" AS INCOME, 'cor(MONTH, INCOME)')




Panel
titleInput
Table1


Month : INTIncome : INT
1
100
1
300
2
400
3
300
4
500




Panel
titleOutput
Result


Column1 : FLOAT
0.7497771504927777






In this example the sum of a column is calculated via an R script, executed by RAGG.



Panel
titleQuery
Query


Code Block
languagetext
themeDJango
TABLE ( RAGG("Table1"."Column1" AS STRC, 'sum(STRC)'))




Panel
titleInput
Table1


Column1 : INT
0
1
2
3
4




Panel
titleOutput
Result

Column1 : RAGG

10