It looks to me as if the numbers you are allocating are in Cube B and you want to allocate them into something like Cube A. But to do any allocations you need drivers at the level to which you are allocating. Are these in Cube A? If so, you would build a Cube C dimensioned by
Month
Product - with parents matching Product Categories in Cube B
DriverLine (Input/Driver/Output)
It gets a bit more fiddly now because you need to find the amount to allocated for each N level of product. You will probably need to assign Category as an attribute of Product to get this to work properly, as (I think) you have multiple hierarchies of product.
Then
['Input'] = <_not N or C> db('B',!Month,!Product);
# this will pull in values where product matches product category
['Driver'] = n:db('A',!Month,!Product,'<whatever sales measure you are using>');
['Output'] = n:
db('C',!Month,attrs('Product',!Product,'Category'),'Input') *
['Driver'] \
db('C',!Month,attrs('Product',!Product,'Category'),'Driver')
;
And the feeders probably need adjusting since the numbers are coming in further up, so in A:
['Sales Measure you are using'] => DB('C',!Month,!Product,'Driver');
and in C:
['Driver'] => ['Output'];
I hope that doesn't put you off

. The major benefit of doing it via rules is that the whole calculation is provable and traceable. And once you've got your head round it you can take the same approach to a much more complex level if you need to.
Good luck!