Page 1 of 1

FSG calculation column, need help ?

Posted: Mon Mar 05, 2007 12:38 am
by efends
Hi experts,

Can I do calculation like below with FSG :
I have DR, CR column, say

DR CR
=====
10 0

I want to define 2 new column (DR_VAL & CR_VAL) where :
- DR_VAL will be show only if DR - CR >= 0
- CR_VAL will be show only if DR - CR < 0.

TIA,
efends

Posted: Mon Mar 05, 2007 1:27 am
by admin
Pl check the display option,

Display Zero: Use to print the row or column when it has a zero balance. If you do not choose this option, the row or column is suppressed on reports when it has a zero balance.

thanks

Posted: Mon Mar 05, 2007 4:57 am
by efends
say i have 2 rows data :

DR CR DR_VAL CR_VAL
100 0 100 0
200 500 0 300

The logic like this :
DR_VAL = DECODE(SIGN(DR-CR), 1, DR-CR, 0))
CR_VAL = DECODE(SIGN(DR-CR), -1, ABS(DR-CR), 0)

It is possible to do that ?

Thanks,
Fendy