[Noob] How to round up values

12 views
Skip to first unread message

Daniel Da Silva Santos

unread,
Jun 18, 2017, 10:44:16 PM6/18/17
to OpenRefine
How to round up values

Hello!
Really noob question here:

I'm working with some rain volume data here, and I have the following question:
The lower number of rain volume in my data set is 0, and the larger number is 67. How can I group this values, so that if the number is between 0 and 10, it changes to 10, and if it is between 10 and 20, it changes to 20, and so on?

Also: Is open refine the best software to do this, or is Excel more recommended?
Thanks in advance!

Ettore Rizza

unread,
Jun 19, 2017, 3:30:08 AM6/19/17
to OpenRefine
Click on "Edit column" - > "Add column based on this column" and try this GREL formula :

ceil(value.toNumber() / 10.0) * 10


Ettore Rizza

unread,
Jun 19, 2017, 3:34:36 AM6/19/17
to OpenRefine
This one is better, it takes into account the zeros :

if(ceil(value.toNumber() / 10.0) * 10 != 0, ceil(value.toNumber() / 10.0) * 10, 10)
Reply all
Reply to author
Forward
0 new messages