martes, 18 de enero de 2011

Agregación Running SUM


Dos ratios:
*Ventas
*Ventas n-1

Derivado:
*Acumulado por mes... =RunningSum([Vendas]; ([L01 Período contábil]))
*Aculumado por year =RunningSum([Vendas]; ([L01 Exercício]))
*Acumulado por mes n-1... =RunningSum([Vendas n-1]; ([L01 Período contábil]))
*Aculumado por year n-1 =RunningSum([Vendas n-1]; ([L01 Exercício]))


*%Var del mes y del year
=If (((RunningSum([Vendas]; ([L01 Período contábil]))/RunningSum([Vendas n-1]; ([L01 Período contábil]))))-1)=(-1) Then "N.A." Else ((RunningSum([Vendas]; ([L01 Período contábil]))/RunningSum([Vendas n-1]; ([L01 Período contábil])))-1)

=If (((RunningSum([Vendas]; ([L01 Exercício]))/RunningSum([Vendas n-1]; ([L01 Exercício]))))-1)=(-1) Then "N.A." Else ((RunningSum([Vendas]; ([L01 Exercício]))/RunningSum([Vendas n-1]; ([L01 Exercício])))-1)

Previous Amount

Intervalo de edad

DATA: years type numc2,
months type numc2,
days type numc2.

CALL FUNCTION 'ZHRCM_TIME_PERIOD_CALCULATE'
EXPORTING
begda = TRAN_STRUCTURE-GBDAT
endda = sy-datum
IMPORTING
noyrs = years
nomns = months
nodys = days
EXCEPTIONS
invalid_dates = 1
overflow = 2
OTHERS = 3.

IF years < 20.
RESULT = 1.
ELSEIF years >= 20 AND years <= 29.
RESULT = 2.
ELSEIF years >= 30 AND years <= 39.
RESULT = 3.
ELSEIF years >= 40 AND years <= 49.
RESULT = 4.
ELSEIF years >= 50 AND years <= 59.
RESULT = 5.
ELSEIF years >= 60 AND years <= 69.
RESULT = 6.
ELSEIF years >= 70.
RESULT = 7.
Else. RESULT =

Running SUM

=If ((RunningSum([Vendas]; ([L01 Período contábil]))/RunningSum([Vendas ano n-1]; ([L01 Período contábil]))))<0 Then "N.A." Else ((RunningSum([Vendas]; ([L01 Período contábil]))/RunningSum([Vendas ano n-1]; ([L01 Período contábil])))-1)


=If (((RunningSum([Vendas]; ([L01 Exercício]))/RunningSum([Vendas ano n-1]; ([L01 Exercício]))))-1)=(-1) Then "N.A." Else ((RunningSum([Vendas]; ([L01 Exercício]))/RunningSum([Vendas ano n-1]; ([L01 Exercício])))-1)



(RunningSum([Vendas]; ([L01 Período contábil]))/RunningSum([Vendas ano n-1]; ([L01 Período contábil])))

domingo, 9 de enero de 2011

Filtro valores mayores que... / Restantes

Filtro de Ventas:(>=200) // SUM(ventas)
Ignorar el filtro: Nofilter ((>=200)) // Nofilter(SUM(sales))

Ej:
Suma de todas las ventas mayores de 200 euros: SUM((>=200))
Suma del resto: Nofilter ((>=200))
Suma de todo: SUM(ventas)

Ordem Meses y Dias --> Configuración regional de Panel Control de Windows

sábado, 8 de enero de 2011

Operadores contextuales

Tenemos:
•in
•Foreach
•Forall
•in Body
•in Block
•in Report
•currentpage

Ejemplos:
Min( In (,)) In
Min( foreach )
Min( forall )
Min( In Report

Obtener %'s sobre el resultado Total

En BEX era muy facil obtener el %sobre el resultado y el resultado total (%CT y %GT).
En BO no es tan directo.
Si tenemos el un importe en euros y quedemos ver el % que cada año supone en el total:
Importe %
2008 100 10
2009 500 50
2010 300 30
Total 1000 100%

Para obtener el %: =/Sum() ForAll
Si con esto navegaramos a otra dimensión, por ej, trimestre, o producto:
%: =/Sum() ForAll
El % se "descuajeringaria".

Lo correcto seria:
= In Body /Sum() In Report