Hello,
I'm working on riddle and it's slowly bringing me to my knees.
I have the following dataset:
| Amount | Group | Group items count | Type | Comment |
| -14689 | A | 2 | N | Long position |
| 0 | A | 2 | N | Long position |
| -50 | B | 3 | N | Long position |
| -7 | B | 3 | N | Long position |
| -6 | B | 3 | N | Long position |
| -59,384.00 | C | 3 | N | Amend the position |
| 686.00 | C | 3 | N | Amend the position |
| 3,082.00 | C | 3 | N | Amend the position |
| -3768 | C | | Y | Amend the position |
| -3000 | D | 2 | N | Amend the position |
| 200 | D | 2 | N | Amend the position |
| -200 | D | | Y | Amend the position |
What my workflow should do in this case is:
- If [Amount] records in [Group] are either 0 or negative - the [Comment] for all records should be populated with "Long position" and change [Type] to 'N' (example: values in group A,
. - If [Amount] records in [Group] are both positive and negative:
- Workflow needs to sum negative values, and sum positive values, and create the rows for each summed values in [Amount] column (if there is 1 of value simply leave it as it is) - example: values in group C, D
- If sum of positive values (in numbers) is less than sum of negative values (in numbers) - change the sum [Type] to 'Y' and [Comment] for all records to [Amend the position]
- If sum of negative values (in numbers) is greater than sum of positive values (in numbers) - change the sum [Type] to 'Y' and [Comment] for all records to [Amend the position]
I hope that I described my "difficulty" and someone may propose a solution.
Thank you in advance.