-
April 27th, 2011, 09:24 PM
#1
[RESOLVED] Compute 2 columns
I have 2 columns Received and Issued, what I want is to compute the 2 columns and show the result on Balance column.
for example:
i have a beginning balance of 100
I input 10 on received and no input on issued column on row(a)
now, if the issued column is equal to 0 then received
column will add to the beginning balance. and now the balance
is 110 on the row(a) where I input the "10".
Now, I input 30 on issued column and no input on recieved column on row(b)
then if the received column is 0 then issued column will subtract
to the balance of row(a) and the difference on Balance Column row(b) will be 80.
Anyone help me here. ..please. .
I need it on my report. .
Thanks in advance
-
April 27th, 2011, 10:46 PM
#2
Re: Compute 2 columns
You need 2 or 3 formula fields
Formula1 (this is the formula name)
Where You assign the initial Balance value
Could be a Field or a Parameter or a Constant
(you didn't say from where you take it)
Place it in the RH or GH section
Code:
WhilePrintingRecords;
numberVar Balance:=100;
Formula2
Where You calculate the Balance
Place it in the Detail Section (this is your balance column)
Code:
WhilePrintingRecords;
numberVar Balance;
Balance:=Balance + {Table.Received} - {Table.Issued};
Balance;
Just change the table and fields names for real ones
If You need to reset to zero the Balance, let's say at GF section, then you'll need the
Formula3
Where You reset to zero
Place it at GF section
Code:
WhilePrintingRecords;
numberVar Balance:=0;
JG
-
April 27th, 2011, 11:51 PM
#3
Re: Compute 2 columns
thanks for help Mr. jggtz
but there's one more problem . . . on issued column there is a negative value. . and the balance still adding the negative. . . not subtracting it. .
how can i make the negative value become positive value. . ??
is it possible to make. .??
if not. .please help me. . .
thanks in advance. .
-
April 28th, 2011, 02:28 AM
#4
Re: Compute 2 columns
Just change the operation sign
Code:
WhilePrintingRecords;
numberVar Balance;
Balance:=Balance + {Table.Received} + {Table.Issued};
Balance;
JG
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|