Home » Developer & Programmer » Reports & Discoverer » Total in Formula
Total in Formula [message #206882] Fri, 01 December 2006 22:46 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I am using this code but row 2 not showing balance , showing null value.

Actual
:cs=row = Number of repeating rows.
Cf_2 = Opening balance (print one time on header)
cf_1 = quantity in repeating row
Quote:

Opening Balance 1,000.00
Date Quantity Balance
1 01.01.2006 100.00 900.00
2 01.02.2006 100.00 800.00
3 01.03.2006 100.00 700.00




function CF_3Formula return Number is
bal number;
begin
if :cs_row = 1 or :cs_row =0 then
bal:=:cf_2-:cf_1 ;
return (bal);
elsif :cs_row > 1 then
return(bal-:cf_1);
end if;
end;

[Updated on: Fri, 01 December 2006 22:48]

Report message to a moderator

Re: Total in Formula [message #206904 is a reply to message #206882] Sat, 02 December 2006 02:31 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
Please see attached file. In this file you can see actual problem in balance KGS.

@ first Row == Opening KGS - Plan KGS = 32520 OK
@ 2nd row === First row Balance KGS - Plan KGS = Balance NOT OK
Problem is that..... & I used above mentioned formula.



OK Dear Thank your all of you.

sipmle I did that sum PlanKGS via summary column of repeating row -
then opening balance - summary column

[Updated on: Sat, 02 December 2006 03:25]

Report message to a moderator

Re: Total in Formula [message #206920 is a reply to message #206904] Sat, 02 December 2006 05:05 Go to previous messageGo to next message
kkinapps
Messages: 29
Registered: November 2006
Location: Hyderabad
Junior Member

Hi kamran

Use the following code instead. I think it works

function CF_3Formula return Number is
begin
if :cs_row = 1 or :cs_row =0 then
:bal:=:cf_2-:cf_1 ;
return (:bal);
elsif :cs_row > 1 then
:bal:=:bal-:cf_1;
return(:bal);
end if;
end;

Note:where :bal is a place holder column

please let me know the result of it

Bye
KK
Re: Total in Formula [message #207265 is a reply to message #206920] Mon, 04 December 2006 21:53 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
hi kamran,

i am sending one rdf but i don't know how much it helps you... as i have seen your previous copy of you problem

where you have to do : 32520 - 660 = 32520
32520 - 600 = < this is not coming correct>

Try this...

Bye
Ashu
  • Attachment: yarn_stat.RDF
    (Size: 72.00KB, Downloaded 1137 times)
Re: Total in Formula [message #207295 is a reply to message #206882] Mon, 04 December 2006 23:49 Go to previous message
gladiator
Messages: 21
Registered: April 2006
Location: Lahore, Pakistan
Junior Member
Hello,

well guys try this solution.
Use a count function in the frame where u want to do a running total and just reset the value of ur running total variable in a formula column where count is equal to 1.

I am attaching the example file.

WISH U GOOD LUCK
good bye.
Previous Topic: Want to order by at run time?but problem is this that i have 2 different datatypes
Next Topic: Dot Matrix Report - Printer Problem
Goto Forum:
  


Current Time: Wed Jul 03 05:05:31 CDT 2024