Future in the past is used when you want to discuss something in the past that you thought would happen in the future. It doesn’t matter whether the thing actually ended up happening. You use future in the past to discuss a plan or a promise from the past.
There are two ways to form the future in the past. One way is to use was/were going to + verb, as in, “He was going to go to the movies last Friday night.” At some point in the past, he had a plan to go to the movies last Friday night. “Last Friday night” is sometime between the moment when he made the plan and now.
Brian uses this type of future in the past when he says, “That’s what I was going to say.” In the past, he has the idea to say something. Then, Andy said it. Finally, Brian uses the future in the past to explain that he had the idea to say the same thing.