Skip to Content
0
Former Member
Sep 17, 2010 at 06:35 PM

Allocation - Division by Zero

116 Views

Hi,

I have the following problem, i'm trying to run allocations, where sometimes the total value is 0, and since my factor is USING/TOTAL, it gives me division by zero, is there anyway to check if the total is zero and skip that allocation?

Here is my code;

*RUNALLOCATION
			*FACTOR USING/TOTAL
			*DIM CATEGORIA 			WHAT=BDTRABALHO;			WHERE=<<<;					USING=<<<;		            TOTAL=<<<
			*DIM TEMPO 				WHAT=%ANO%;			WHERE=<<<;					USING=<<<;		            TOTAL=<<<
			*DIM CONTAVENDAS 		            WHAT=VOLUME;			WHERE=<<<;				            USING=<<<;			TOTAL=<<<
			*DIM PRODUTO 			WHAT=%PRODUTO_TEMP%_IN;          WHERE=BAS(%PRODUTO_TEMP%);	            USING=<<<;			TOTAL=%PRODUTO_TEMP%
			*DIM ORGCOMERCIAL 		            WHAT=NAORGCOM;			WHERE=<<<;					USING=<<<;	                        TOTAL=<<<
			*DIM CANAL 				WHAT=NACANAL;			WHERE=<<<;					USING=<<<;      		TOTAL=<<<
			*DIM FONTEDADO 			WHAT=INPUT;				WHERE=ALOCEMBALAGEM;			USING=TOTALCOMALOC;	TOTAL=<<<
		*ENDALLOCATION

That code is inside a for loop that handles all the variables in it.

I'd really appreceate your help.

Thanks