Question: I have some panel data with id, year and a variable indicating whether the individuals are treated at that point in time:

```
id  year   treated  
1   2000      0            
1   2001      0            
1   2002      1            
1   2003      1            
1   2004      1            

```

I need to create a dummy to indicate the year in which the treatment first happened. The desired output is something like:

```
id  year   treated   treatment_year
1   2000      0            0
1   2001      0            0
1   2002      1            1
1   2003      1            0
1   2004      1            0

```

It seems fairly simple to me but I've been stuck for a while and I cannot get any ordering function to do this. Thanks a lot for any help

Answer: 
try:

```
const getUserOrder = await this.getUserOrder();
getUserOrder.subscribe(data => {
...

```

The reason is that you are missing `await`

---

Like @Brendan B mention there's also no reason for the `async` on `getUserOrder` method actually, sense you are returning an Observable. You can also delete the `async` keyword from this method and it'll work.
async functions don't return promises, you are trying to subscribe to a promise.

Try removing the async from `async getUserOrder()`