If this forum had a FAQ page, this would be on the top of the list. I'm glad you asked the question before proceeding and doing it wrong. The flange is attached to the drain so that it rests on top of the finished floor. It then needs to be screwed through the finished floor and into the sub floor. If the finished floor is tile, you may want to notch the tiles when laying them to accommodate the screws as drill holes can be difficult. I would suggest using several #12 stainless steel screws to insure they will not rust out. Since the flange needs to rest on top of the finished floor, you may want to wait until the flooring is laid before cutting the drain pipe to length so the fit will be right. Certainly make sure the flange sets level on the floor so that the toilet will seat properly.