How to execute getactive session function before compare excel function angular 8?

I work on angular 8 i have two subscribe
i need to execute first subscribe and after finish
execute second subscribe
but i don’t know how to make it please ?
first function i need to execute is
getactivesession

second function i need to execute it
compareexcel
so how to do that please ?

What I have tried:

execute it first
this._dataService.getActiveSessions(flagButton).subscribe(resp => {
      if (resp) {
        alert('There are active session working')
      } else {
        console.log('nooo');
      }
    });

execute it second

          this._dataService.PostUpload(this.selectedoptions,this.fileToUpload)
      .subscribe(blob => {
      saveAs(blob.body, this.fileToUpload.name +'.xlsx');
       });

You can chain operators in rxjs: RxJS documentation for operators.