Gets the parent ID of the required level.