Not straightforward. The issue is that you create a pipe schedule. However the spool length is more than the pipe length. In you case it seems the pipe enters the flange up to the last 3 mm of the flange. So with every flange the spool length is 3 mm longer than the pipe.
There are a few things you can do about it. In the pipe you can add project parameters (flange "left", flange "right") of type yes/no. In the project you would have to mark with pipe has one or two flanges. (you also could use an integer 0/1/2 for the amount of flanges).
In the schedule you can create a formula to calculate the spoollength based on the amount of flanges.
Something like this.

You probably can create script that based on your project can set the yes/no (or integer) parameters based on the amount of connected flanges.
Other alternative would be to create a multi category schedule where you would filter on your pipes and pipe fittings (flanges). Then you could add flanges and pipes together. However as Length is not available as parameter in a multi category schedule you would have to create a new project parameter of type length to your fittings and pipes.
Here you also can use Dynamo to fill the new length parameter.
And of course you can also dimension your spools and use notes on your drawings so that people know how to translate pipe length to spool length.
There are more solutions to this issue. Maybe others who do spooldrawings on regular basis have alternative methods.
Louis

Please mention Revit version, especially when uploading Revit files.