Previus value

34 views
Skip to first unread message

fabius pocus

unread,
Aug 11, 2022, 2:27:31 PM8/11/22
to OpenRefine
Hi. I'd like to obtain the value of previus element [row.index -1]. I know that the actual value is value directly. I think that something like cells[row.index- 1].value but it fails. Thanks for any help,

Fabio

Antoine Beaubien

unread,
Aug 12, 2022, 9:11:27 PM8/12/22
to OpenRefine
Hi Fabio,

   To get a value from a preceding row (unsorted…), use the cross() function.
This grel expression will get the value of the previous row in the column named « Column 1 »:

 cross(rowIndex-1)[0].cells["Column 1"].value

Since OR v3.4, the cross() function is very powerful as it can get linked (joined in SQL terms) data from pretty much any project.

Regards,
   Antoine

fabius pocus

unread,
Aug 12, 2022, 9:14:34 PM8/12/22
to openr...@googlegroups.com
Thanks a lot! 

--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/94759934-fce2-4ece-af1d-367c6bf962c6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages