Hello I am trying to label a column based on certain criteria. Basically I have charges and refunds and want to label the refunds and the associated charges with a column descr with 0 and charges without refunds a 1. I have tried using the multi-row formula tool but have not been able to figure out how to associate one refund with only one charge if this makes sense.
I currently have these if statement for the multi-row formula tool (which are repeated out to the +7 rows):
If [entryid]=[row-1:entryid] and ([amount]*-1)=([row-1:amount]) then 0
If [entryid]=[row+1:entryid] and ([amount]*-1)=([row+1:amount]) and [type] = 'refund' then 0
This will obviously counts multiple charges that are not associated with one refund and would not cover all prior rows:
It should also be noted this is sorted by date time in descending order (grouped by id)
Current example:
| ID | amount | type |
| 2 | -250 | refund |
| 2 | -250 | refund |
| 2 | -50 | refund |
| 2 | 150 | charge |
| 2 | 50 | charge |
| 2 | 250 | charge |
| 2 | 50 | charge |
| 2 | 250 | charge |
| 2 | 250 | charge |
Expected:
| ID | amount | type | descr |
| 2 | -250 | refund | 0 |
| 2 | -250 | refund | 0 |
| 2 | -50 | refund | 0 |
| 2 | 150 | charge | 1 |
| 2 | 50 | charge | 0 |
| 2 | 250 | charge | 0 |
| 2 | 50 | charge | 1 |
| 2 | 250 | charge | 0 |
| 2 | 250 | charge | 1 |
Any help or direction would be much appreciated!