Fork-join with condition
Posted: Fri Jan 12, 2018 1:16 pm
Hi,
This simple programming task made me spent couple of days trying to implement in ds, to no avail
If I have this data:
I'd lke to output to become just one row, where col2 is the last non zero value read.
My approach is compare current_value versus previous_value, so if current_value is zero, it take previous_value. Given the data above, my output becomes:
To think that I still need to hurdle the joining the data into one row.
Any ideas how to solve the above problems?
TIA!
This simple programming task made me spent couple of days trying to implement in ds, to no avail
If I have this data:
Code: Select all
col1 col2
id1 5
id2 0
id3 0
id4 0
id5 0
I'd lke to output to become just one row, where col2 is the last non zero value read.
Code: Select all
col1 col2
row 5
Code: Select all
col1 col2
id1 5
id2 0
id3 5
id4 0
id5 5
To think that I still need to hurdle the joining the data into one row.
Any ideas how to solve the above problems?
TIA!