-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a variable to refer to other rows #3305
Comments
Similar to #1340 |
@allanaaa Hi there, I'm using the following workaround to compare values between a row and its following:
|
I think there is now a standard syntax using the I suggest we change this issue into a documentation issue (on the openrefine.org repo), where the task would be to document this workaround in https://openrefine.org/docs/manual/expressions |
I confirm this works with a slite change: It's the same as: Regards, Antoine |
ah yes, simply |
Hah - this is excellent - I had not realised this and have been abusing the record mode to achieve similar things |
@wetneb @ostephens So I think this issue can be closed now and a new doc improvement issue can be made? It would be "swell" if @ostephens took that up for us, since I feel he might explain it very well for others. |
Agreed, I have opened an issue accordingly: OpenRefine/openrefine.org#214 |
I was wondering if there was a way to compare two rows' values to each other. For example, I wanted to create a column using diff() on a column of dates, outputting the distance between row1's date and row2's date (and subsequently between row2's date and row3's date, etc.).
There doesn't seem to be a way to call "the value of this cell in [this row's index plus one]". You can call other cells in the same row (by pointing to a specific column, with syntax like cells["Dates"].value), but not other cells in the same column (by pointing to a specific row with rowIndex).
Another use case: you could transform your data by transferring all the values in a column up by one or more cells.
Proposed solution
What I would like is a way to pull from any row's cell values by its index number. Both absolutely and relatively - as in, "row 6" as well as "this row minus two". I am terrible at syntax so I'll leave that bit to someone else.
It may also be useful to have a variable for the total number of rows/records in the project. (Which we offer at a smaller scale with row.record.rowCount.)
The text was updated successfully, but these errors were encountered: