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> column totals

Read-Only Read-Only Topic
Go
Search
Notify
Tools
<SOLVED> column totals
 Login/Join
 
Gold member
posted
I have two column totals.
 ON TABLE COLUMN-TOTAL AS 'TOTAL' totearlyinvamt totlateinvamt 
The totearlyinvamt is coming out correct but the totlateinvamt is not. In fact it isn't even close. Here are the column definitions.
  totearlyinvamt/D12.2CSM AS 'Invoice Amount,Paid Early'
     totlateinvamt/D12.2CSM AS 'Invoice Amount,Paid Late'
Here are the defines for each.
  IF paydate1 LE DUE_DATE THEN totearlyinvamt + GROSS_AMOUNT ELSE 0
 IF paydate1 GT DUE_DATE THEN totlateinvamt + GROSS_AMOUNT ELSE 0 
Can anyone help with this?

This message has been edited. Last edited by: Tracie,


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Virtuoso
posted Hide Post
Are Are you sure the individual amounts are correct in totlateinvamt? Are you capturing everything that should be in that define? If the Total is incorrect...then I would imagine it is the individual amounts that are incorrect.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Gold member
posted Hide Post
The totals are correct. The totlateinvamt starts out as correct. Invoice amt $150 on the first line/totlateinvamt = "$150. Second line invoice amt is $200/totlateinvamt is $350 and so on. The number is correct until it hits the first line contains an paid early amount.


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Gold member
posted Hide Post
Here are the first two lines of the report
$89,732.47 total late $89,732.47 
$42,570.50 total late $132,302.97 
It keeps adding this way until::
  $4,410.40 total late $371,442.90 
$22,391.86 total early $22,291.86  
$3,813.10 total early $26,204.96   
$25,106.61 total early $51,311.57   
$10,997.00 total early $62,308.57   
$5,195.40 total late $5195.30 
$67,175.58 total early $67,175.58   
$2,484.58 total late $2,484.58 
                    
Total early  $229,392.54 This number is correct.
Total late $3,845,744.34 (should be 379,122.88) 


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Platinum Member
posted Hide Post
Is the date comparison working?

IF paydate1 GT DUE_DATE


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Gold member
posted Hide Post
Yes, the date comparison is working. The ones that should be early are and the ones late are showing as late.


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Virtuoso
posted Hide Post
Could you give us all of your code? I am not even seeing how you are using column-total. From your example, it appears like you are creating a running total, not a column-total.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
 PRINT 
     SERIES_ID AS 'Invoice Type'
     GROSS_AMOUNT/D20.2CM AS 'Invoice,Amount'
     INVOICE_DATE/MDYY AS 'Invoice Date'
     DUE_DATE/MDYY AS 'Due Date'
     paydate1/MDYY AS 'Date Paid'
     diff AS 'Days ,Behind/Ahead'
     posneg/A40 AS ''
     totearlyinvamt/D12.2CSM AS 'Invoice Amount,Paid Early'
     totlateinvamt/D12.2CSM AS 'Invoice Amount,Paid Late'
BY INVOICE_NO AS 'Invoice No.'
HEADING
"Customer No:  <+0>&IDENTITY<+0>    <NAME "
FOOTING
"Prepared on: <+0>&DATEtrMDYY <+0>        "
" Page:<TABPAGENO"
ON TABLE SUBFOOT
"Total number of invoices paid late:  <late      Total number of invoices paid early:   <early "
" Total number of invoices:     <totalinvoices  "
WHERE ( IDENTITY EQ '&IDENTITY.Customer No:.' ) AND ( STATE EQ 'PaidPosted' );
WHERE SERIES_ID EQ 'CD';
WHERE GROSS_AMOUNT GT 0;
WHERE ( PAY_DATE GE DT(&FromPaidDate.From Date Paid.) ) AND ( PAY_DATE LE DT(&ToDatePaid.To Date Paid.) );
ON TABLE SET PAGE-NUM OFF 
ON TABLE COLUMN-TOTAL AS 'TOTAL' totearlyinvamt totlateinvamt
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE * 
Here you go. Thanks for the help.


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Virtuoso
posted Hide Post
I think there are some things missing. Where are your defines? You also reference fields in you subfoot lines that don't appear anywhere. Are they also in the defines?

Without seeing all of the code, here are a couple suggestions: It appears that totearlyinvamt and totlateinvamt are running totals. This would not appear correctly if you are trying to add a column-total to a running total column. Also, I usually use

ON TABLE SUBTOTAL AS 'TOTAL'
totearlyinvamt
totlateinvamt


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
 IF paydate1 LE DUE_DATE THEN totearlyinvamt + GROSS_AMOUNT ELSE 0 
 IF paydate1 GT DUE_DATE THEN totlateinvamt + GROSS_AMOUNT ELSE 0 
Here are the defines. The first one for totearlyinvamt and the second one is for totlateinvamt. I tried your suggestion and got the same results.

This message has been edited. Last edited by: Tracie,


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Virtuoso
posted Hide Post
Tracie

Your defines of the totearlyinvamt and totlateinvamt should be done in the table part and not as predefined fields.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
How do I create these fields in the Table part using the report painter? Thank you.


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report This Post
Virtuoso
posted Hide Post
quote:
IF paydate1 LE DUE_DATE THEN totearlyinvamt + GROSS_AMOUNT ELSE 0
IF paydate1 GT DUE_DATE THEN totlateinvamt + GROSS_AMOUNT ELSE 0


This would not be correct syntax for a define. By this, do you mean:
DEFINE FILE xxx
totearlyinvamt/D12.2=IF paydate1 LE DUE_DATE THEN totearlyinvamt + GROSS_AMOUNT ELSE 0 ;
totlateinvamt/D12.2=IF paydate1 GT DUE_DATE THEN totlateinvamt + GROSS_AMOUNT ELSE 0;
END

Why are you adding totearlyinvamt back onto itself? And, as this is calculated record by record in the define, that amount will always be zero so it would be the same as

totearlyinvamt/D12.2=IF paydate1 LE DUE_DATE THEN GROSS_AMOUNT ELSE 0;
totlateinvamt/D12.2=IF paydate1 GT DUE_DATE THEN GROSS_AMOUNT ELSE 0;

So for each record, it should have either one amount or the other, but not both, correct?
so try
DEFINE FILE XXX
totearlyinvamt/D12.2=IF paydate1 LE DUE_DATE THEN GROSS_AMOUNT ELSE 0;
totlateinvamt/D12.2=IF paydate1 GT DUE_DATE THEN GROSS_AMOUNT ELSE 0;
END
TABLE FILE XXX
PRINT 
     GROSS_AMOUNT
     INVOICE_DATE
     DUE_DATE
     totearlyinvamt
     totlateinvamt
BY INVOICE_NO 
ON TABLE SUBTOTAL
END


and see what you get.

There are still other pieces of your code that you are not showing that could have some impact on what you are seeing. Without seeing all of it, it's hard to be very exact with a solution.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
JI - too early in the morning - you do have a profile - sorry about that - Michelle


WebFOCUS Production: UNIX 7.7.03M
WebFOCUS Test: UNIX EDASERVE 7.7.05 Client 8.0.01
 
Posts: 28 | Location: Connecticut USA | Registered: August 29, 2006Report This Post
Virtuoso
posted Hide Post
From the description in your second post
quote:
The number is correct until it hits the first line contains an paid early amount

I come to the conclusion that you need to have a kind of running total for the early and late invoices. If that's the case, then the total values in the ON TABLE SUBTOTAL do not make any sense to me. But that's beside the issue at hand. If you need to have this running total continue even if the date changed back and forth, code the defines as:
IF paydate1 LE DUE_DATE THEN totearlyinvamt + GROSS_AMOUNT ELSE totearlyinvamt  
IF paydate1 GT DUE_DATE THEN totlateinvamt + GROSS_AMOUNT ELSE totlateinvamt

Now the total values of the early/late invoice stay intact when the date changes, in stead of being reset to 0.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
That solution worked. Thanks


WebFocus 7703
Windows 7
Output format: HTML, Excel, PDF
 
Posts: 54 | Registered: May 07, 2008Report 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> column totals

Copyright © 1996-2020 Information Builders