I'll try and keep this short/clear...
Stockpile A is the general stockpile, takes from anywhere, takes e.g. all wood. It has give links to stockpiles B1, B2, ..., Bn (where n is an integer). This is the step you'll most likely have wheelbarrows on, if the item type in question is heavy (mostly stone, but e.g. metal furniture may qualify).
B1, B2, ..., Bn thus each take from A. (These should be a few tiles in size to allow for smooth loading into minecarts in the next step.) The trick is that the B stockpiles each only take 1 type/color/density/whatever of wood. Wheelbarrows are a possibility. These can be either take only from links or take from anywhere.
Next you setup the QSP by building a dumping track stop for each B-stockpile, and define a minecart route with 1 stop on said track stop. Add a minecart to the stop. Remove all commands from the stop. Add the correct B-stockpile as a source stockpile. You can set desired items as e.g. all wood types, since the filtering has already been done at this point.
Then you setup the final quantum stockpiles, which we'll call C1, C2, ..., Cn for consistency's sake. They're each only 1 tile in size (no wheelbarrows!) and are dumped onto by minecarts (=located next to the track stops). Again, the sorting has already been done, so you can just enable all wood. However, I would recommend that the C stockpiles have "take only from links" and have no links, to stop dwarves from manually hauling something there if/when it's empty. Another option is to have the C stockpiles only accept the item that you want in each, so even if there are filtering errors earlier in the process, any stray wood that shouldn't be on the QSP should get carried back to A or B.
Note that the B stockpiles are not absolutely necessary, you can set the filtering by specifying the desired items for each minecart stop. I just included it as an intermediary step for an attempt at clarity.