Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I have the below data set where i only have Value column. What i would like to create is DesiredValue_Column. In other words, i would like to scan the contents of Value column and repeat the same number if Value column is not null. If value column is null then repeat the previous number from Value column until value column is not null.
For example after value =3, it is null there i repeat 3 until value = 6 and then i simply copy the content of 6. Hope this makes sense. Any guidance is appreciated. Thanks.
Value | DesiredValue_Column |
1 | 1 |
2 | 2 |
3 | 3 |
3 | |
3 | |
6 | 6 |
7 | 7 |
7 | |
7 | |
10 | 10 |
Try like:
Load
If(len(trim(Value))=0, Peek(NewValue), Value) as NewValue
You can create one variable with the function of peek then the value should be repeated
Try like:
Load
If(len(trim(Value))=0, Peek(NewValue), Value) as NewValue