cancel
Showing results for 
Search instead for 
Did you mean: 

regarding sum

Former Member
0 Kudos

Post Author: prasadkambala

CA Forum: Formula

Hi,

I have 3 tables named Account,Debit,Credit

IN account table accountId is the primary key, so the table contains data like

ACCOUNTID

11111

22222

33333

44444

In debit and credit tables ACCOUNTID is not primary key,so these table contain data like

DEBIT TABLE CREDIT TABLE

DEBIT.ACCOUNTID DEBIT.AMOUNT CREDIT.ACCOUNTID CREDIT.AMOUNT

11111 20000 33333 30000

11111 30000 33333 10000

now my requirement is, i want to create a formula feild which sums

if(ACCOUNT.ACCOUNTID=DEBIT.ACCOUNTID) then sum(DEBIT.AMOUNT)

else if(ACCOUNT.ACCOUNTID=CREDIT.ACCOUNTID) then sum(CREDIT.AMOUNT)

When i use this formula it is not displaying any rows.

It should print like

ACCOUNTID AMOUNT

11111 5000033333 40000

please slove my problem.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Post Author: V361

CA Forum: Formula

Grouped by Account id, and I used to seperate formulas and just left aligned them,

if({Account_.ACCOUNTID}={Credit_.CREDIT#ACCOUNTID }) then sum({Credit_.CREDIT#AMOUNT})

if({Account_.ACCOUNTID}={Debit_.DEBIT#ACCOUNTID }) then sum({Debit_.DEBIT#AMOUNT})