Former Member

# RUNALLOCATION problem with FACTOR=USING/TOTAL

Hi guys!

I have accounts: A = 100.00 and B = 0.00, B is parent node for B01,B02: B01 = 0.00 B02 = 0.00

I need: B = 100.00 (from A) (B01 = 50.00, B02 = 50.00) (Other question is how can I get something like B01 = 30, B02 =70 etc.) So I use code:

```*RUNALLOCATION
*FACTOR=USING/TOTAL
*DIM X_ACCT WHAT=A;WHERE=BAS(B);USING=<<<;TOTAL=<<<
*DIM P_TIME WHAT=2011.JAN.01;WHERE=<<<;USING=<<<;TOTAL=<<<
*DIM RPTCURRENCY WHAT=USD;WHERE=<<<;USING=<<<;TOTAL=<<<
*DIM P_ENTITY WHAT=XXX;WHERE=<<<;USING=<<<;TOTAL=<<<
*DIM CATEGORY WHAT=XXX;WHERE=<<<;USING=<<<;TOTAL=<<<
*ENDALLOCATION
*COMMIT```

and get warning: divided by zero in Allocation (B = 0.00 (B01 = 0, B02 = 0)

when I "remove"

`*FACTOR=USING/TOTAL`

and run script I get B = 200.00 (B01 = 100.00, B02 = 100.00)

After that I run script again with

`*FACTOR=USING/TOTAL`

and get correct result B = 100.00 (B01 = 50.00, B02 = 50.00)

What is wrong? How can I fix it? I don't want run script twice without and with FACTOR

Regards,

Maxim

10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on Dec 09, 2011 at 07:50 AM

I am not sure is it the same prolem or not, but if there are no data, script doesn't work. For example

```..
*WHEN P_ENTITY
*IS AAA
*WHEN P_TIME
*IS 2011.JAN.01
*REC(EXPRESSION=100)
*ENDWHEN
*ENDWHEN
..```

But if there are any data, script work! Is it possible write data to "empty" element?

10|10000 characters needed characters exceeded
• Former Member Gersh Voldman

Below code ,copies 1 to all base accounts of B irrespective of hierarchy complexity of B . This logic might be required to run before first run of allocation .As after first run ,there would be some reference data in BAS accounts based on which the subsequent execution of allocation works with out errors .

```*XDIM_MEMBERSET ACCOUNT = BAS(B)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION =1)
*ENDWHEN .
```

Hope this helps.