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] Display difference of 2 subtotals in 3rd subtotal

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Display difference of 2 subtotals in 3rd subtotal
 Login/Join
 
Platinum Member
posted
Hello,

My report has 3 subtotals - I am trying to show difference of 1st two subtotal amounts as 3rd subtotal.. I have a computed field to do that but I can't get the difference in the 3rd subtotal.. I just get the sum ..

Can anyone help me out here?

Thanks in advance!

This message has been edited. Last edited by: FP Mod Chuck,


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
I'm not sure if I understand where the issue is. Doesn't this give you the right results?
 
TABLE FILE CAR
SUM RETAIL DEALER
COMPUTE DIFF/D12.2=RETAIL-DEALER;
BY COUNTRY 
BY CAR
ON COUNTRY SUB-TOTAL
END
 


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
This doesn't work for me since I do not want to display my computed field.
Also, I have 2 defined fields (which I do not display) and my computed fields is difference between these 2 defined fields.

For example:
DEFINE FILE SQLOUT
CR_AMOUNT/D20.2 = IF T_TYPE EQ 'CR' THEN AMOUNT;
DB_AMOUNT/D20.2 = IF T_TYPE EQ 'DB' THEN AMOUNT;
END

TABLE FILE SQLOUT
PRINT
...
.....
COMPUTE DIFF/D20.2 = CR_AMOUNT - DB_AMOUNT; NOPRINT
.....
BY SORTFIELD1 NOPRINT
BY SORTFIELD2 NOPRINT
BY SORTFIELD3 NOPRINT
ON SORTFIELD1 SUBTOTAL DIFF AS 'Total: '
.........
........


So I can't get the subtotal to display the difference.


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
 
TABLE FILE CAR
SUM RETAIL DEALER
COMPUTE DIFF/D12.2=RETAIL-DEALER; NOPRINT
BY COUNTRY 
BY CAR
ON COUNTRY SUBHEAD
"SUBTOTAL FOR THE DIFFERENCE FOR <COUNTRY IS: <ST.DIFF"
END
 


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
Anyway I don't have to use SUBHEAD?
I would really like it to be as a SUBTOTAL line.. Using SUBHEAD changes the report formatting and display and unfortunately that won't be accepted by the report users... Frowner


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
TABLE FILE CAR
SUM 
     DEALER_COST
     RETAIL_COST
     COMPUTE DIFF/D12.2 = RETAIL_COST- DEALER_COST;
BY  COUNTRY
BY  CAR
     
ON COUNTRY SUBTOTAL AS 'Subtotal and the difference'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *

TYPE=DATA,
     COLUMN=N5,
     COLOR='WHITE',
$
TYPE=TITLE,
     COLUMN=N5,
     COLOR='WHITE',
$
ENDSTYLE
END

  


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
I don't see the "ON SORTFIELD2 SUBTOTAL" or 'ON SORTFIELD3 SUBTOTAL" lines in your code...

TABLE FILE SQLOUT
PRINT
...
.....
COMPUTE DIFF/D20.2 = CR_AMOUNT - DB_AMOUNT; NOPRINT
.....
BY SORTFIELD1 NOPRINT
BY SORTFIELD2 NOPRINT
BY SORTFIELD3 NOPRINT
ON SORTFIELD1 SUBTOTAL DIFF AS 'Total: '
.........
........




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Nova,
If I understand correctly, you want to show the difference only at the SUBTOTAL level. The problem is that if you NOPRINT the difference, the SUBTOTAL does not appear, which is logical.
Here is a workaround...
  
-* File Nova27_02.fex
TABLE FILE CAR
SUM RCOST DCOST
COMPUTE DIFF/D6=RCOST - DCOST; 
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL 
ON TABLE SET STYLE *
INCLUDE=ENDEFLT, $
TYPE=DATA, COLUMN=DIFF, SIZE=1,$
ENDSTYLE
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
Virtuoso
posted Hide Post
Same concept as my suggestion except I make the COMPUTED field data and title white effectively making it invisible on a white background.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
The only downside of both the above solutions is that the data is still displayed.

If your output type is HTML then you can always use CSS styling to control the display. See this post from 2008.

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
  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] Display difference of 2 subtotals in 3rd subtotal

Copyright © 1996-2020 Information Builders