I have be wondering if is it possible to create an aggregation and summary of values on OpenRefine on the same way as it is done on python and R? Example:
Table of medical appoints with 300k records Id-patient | Age | Id-appointment | value
The result of aggregating and summarizing by patient would be: Id-patient | last-age | mean-value
I hope to be clear enough, if that function works on Openrefine it would of a great help.
The answer is "yes but"... It's possible, but a bit complicated. Let's take an example.
In order to do aggregate calculations per patient, you must first transform each patient into a record. To do this, move the "Id_patient" column to the beginning and use "blank down" (The id must be sorted beforehand with "Sort..." and "Reoder rows permanently").
After that, you can perform calculations on all the values of each record, considered as an array.
All this will be clearer with a screencast :
The formulas used in the demo are:
GREL:
GREL:
Python/Jython:
As you can see, you can do a lot of things with Open Refine, especially using Pyhon/Jython. BUT calculations is not its main purpose. Open Refine is designed primarily to explore, clean and enrich data. It's not a spreadsheet software. You could do the same much more easily with Pivot Tables in Excel. Just as you can clean up some messy data with Excel, even if it's not the best tool for that.