Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Calculating Outstanding Amount

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Calculating Outstanding Amount
 Login/Join
 
Platinum Member
posted
Hi,
I will appreciate it of someone here can help with how I can calculate outstanding amount. I have Inv_amt (this is fixed) and Payments from customers per Inv_number. Customer can make multiple payments until the Inv_amt is settled.

I am unable to calculate the Outstanding_amount by substracting payments from reducing Inv_amt.

Below is a sample data:
  
Count	Location	Inv_Number 	Desc	Inv_amt 	Payment		OUTSTANDING_AMOUNT
1	A	1111		TESTA	500	310		190
2	A	1111		TESTA	500	190		0

1	B	2222		TESTB	300	200		100
2	B	2222		TESTB	300	40		60
3	B	2222		TESTB	300  	50		10
 
1	C	3333		TESTC	400	250		150
2	C	3333		TESTC	400	150		0


Just you know, the COUNT column is calculated per payments.

The OUTSTANDING_AMOUNT column is not in the database (table) and I need to calculate this in webfocus.

Please, can someone help with codes/explanation on how I can calculate column OUTSTANDING_AMOUNT?

Many thanks.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.7.02
Windows/SQL/CUBES
HTML/PDF/XLS
 
Posts: 117 | Registered: November 18, 2009Report This Post
Virtuoso
posted Hide Post
  
TABLE FILE ttt
SUM
MAX.Inv_amt NOPRINT
Payment NOPRINT
COMPUTE OUTSTANDING/I6=MAX.Inv_amt - Payment;
BY Location BY Inv_Number BY Desc
END
 


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
I tried this but it didn't work.


WebFOCUS 7.7.02
Windows/SQL/CUBES
HTML/PDF/XLS
 
Posts: 117 | Registered: November 18, 2009Report This Post
Platinum Member
posted Hide Post
Please, any help from someone here?


WebFOCUS 7.7.02
Windows/SQL/CUBES
HTML/PDF/XLS
 
Posts: 117 | Registered: November 18, 2009Report This Post
Expert
posted Hide Post
Look at it logically, you want to minus the payment from the outstanding amount invoice by invoice.

So your sort order will need to include invoice number, the first outstanding amount for each invoice amount will be the invoice amount minus the payment for each subsequent payment on that invoice the outstanding amount will be the LAST outstanding amount minus the payment.

Note that the sort order is crucial in getting your calculations correct so you need to think about that.

So you should be able to work out that your COMPUTE would need to be something like -
COMPUTE OUTSTANDING_AMOUNT/D12 = IF Inv_Number EQ LAST Inv_Number THEN LAST OUTSTANDING_AMOUNT - Payment ELSE Inv_Amt - Payment;

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi Tony,
Your suggestion worked. Thank you very much.


WebFOCUS 7.7.02
Windows/SQL/CUBES
HTML/PDF/XLS
 
Posts: 117 | Registered: November 18, 2009Report This Post
Expert
posted Hide Post
That's good! However, I would be happier knowing that you understood why it works Smiler and could utilise the logic elsewhere when needed.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Yes, I got the logic. Thanks once again.


WebFOCUS 7.7.02
Windows/SQL/CUBES
HTML/PDF/XLS
 
Posts: 117 | Registered: November 18, 2009Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Calculating Outstanding Amount

Copyright © 1996-2020 Information Builders