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] SUBTOTAL using MULTIVERB REQUEST

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SUBTOTAL using MULTIVERB REQUEST
 Login/Join
 
Gold member
posted
Hello,

I want to get the subtotals calculated separately by CAR and one total row at COUNTRY level (Country ENGLAND I have chosen) . But, if u see the yellow highlighted request when used as multi verb request am getting the COUNTRY total as CAR individual SUB TOTALS. I have created a computed column that creates the % value which I wanted to see in the COUNTRY wise total row and not CAR SUBTOTAL ROW.

below is the code.

TABLE FILE CAR
PRINT *
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS CNTRY
END

TABLE FILE CNTRY
SUM 
COMPUTE DC/D12.1 = ((DEALER_COST * 10) /100); NOPRINT
BY COUNTRY NOPRINT

SUM 
DEALER_COST NOPRINT
BY COUNTRY NOPRINT
BY CAR NOPRINT

PRINT 
CAR DEALER_COST  
BY COUNTRY  
BY CAR

ON CAR SUBFOOT
"CAR <DEALER_COST"

ON COUNTRY SUBFOOT
"COUNTRY <TOT.DEALER_COST <<<<  <DC "

END
  

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


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 07, 2008Report This Post
Virtuoso
posted Hide Post
Not sure if will answer your need, but the following two code does same result in two different way.
TABLE FILE CAR
SUM RETAIL_COST
    DEALER_COST
    COMPUTE PCT/D12.1% = ((DEALER_COST / RETAIL_COST) * 100);
BY COUNTRY
BY CAR
BY MODEL

ON CAR SUBTOTAL RECOMPUTE AS 'CAR TOT'
ON COUNTRY SUBTOTAL RECOMPUTE AS 'COUNTRY TOT'

WHERE COUNTRY EQ 'ENGLAND';
ON TABLE NOTOTAL
END


TABLE FILE CAR
SUM RETAIL_COST AS 'COUNTRY TOT RCOST'
    DEALER_COST AS 'COUNTRY TOT DCOST'
    COMPUTE PCT1/D12.1% = ((DEALER_COST / RETAIL_COST) * 100);
BY COUNTRY

SUM RETAIL_COST AS 'CAR TOT RCOST'
    DEALER_COST AS 'CAR TOT DCOST'
    COMPUTE PCT2/D12.1% = ((DEALER_COST / RETAIL_COST) * 100);
BY COUNTRY
BY CAR

PRINT MODEL RETAIL_COST DEALER_COST
BY COUNTRY  
BY CAR

WHERE COUNTRY EQ 'ENGLAND';
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Hi Martin,

Thank you! for the code. I just modified little but and trying to bring the retail cost as subtotal using the subfoot. But if you see, CAR subfoot (subtotal) values I suppose to get by car
and ultimately by country. I'm getting country level total as even at car level.

if you take car "JAGUAR" I suppose to get 18621 where as I'm getting country level total i.e. 45319

Would there be anything I need to take care for this ?

TABLE FILE CAR
SUM RETAIL_COST AS 'COUNTRY TOT RCOST' NOPRINT
    DEALER_COST AS 'COUNTRY TOT DCOST' NOPRINT
    COMPUTE PCT1/D12.1% = ((DEALER_COST / RETAIL_COST) * 100);
BY COUNTRY

SUM RETAIL_COST AS 'CAR TOT RCOST' NOPRINT
    DEALER_COST AS 'CAR TOT DCOST'  
    COMPUTE PCT2/D12.1% = ((DEALER_COST / RETAIL_COST) * 100);
BY COUNTRY
BY CAR

PRINT MODEL RETAIL_COST DEALER_COST
BY COUNTRY  
BY CAR

ON CAR SUBFOOT
"CAR SUBFOOT <RETAIL_COST"
ON COUNTRY SUBFOOT
"COUNTRY SUBFOOT <RETAIL_COST"
WHERE COUNTRY EQ 'ENGLAND';
END
  


thank you so much!
 
Posts: 78 | Registered: January 07, 2008Report This Post
Expert
posted Hide Post
Use column notation -
ON CAR SUBFOOT
"CAR SUBFOOT <C4"

C4 in this instance is the DEALER_COST AS 'CAR TOT DCOST' which is the 4th output column that is output e.g. when you count ignore NOPRINT fields.

Check out this help file

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
Virtuoso
posted Hide Post
Since column notation can be confusing, I usually use DEFINEs to help eliminate confusion about which values are used in the different multi-verb levels and subsequent COMPUTEs and SUBFOOTs:

DEFINE FILE CAR
 RETAIL_COST_COUNTRY/D7 = RETAIL_COST ;
 DEALER_COST_COUNTRY/D7 = DEALER_COST ;
 RETAIL_COST_CAR/D7     = RETAIL_COST ;
 DEALER_COST_CAR/D7     = DEALER_COST ;
END
-*
TABLE FILE CAR
SUM RETAIL_COST_COUNTRY  NOPRINT
    DEALER_COST_COUNTRY  NOPRINT
    COMPUTE PCT1/D12.1% = ((DEALER_COST_COUNTRY / RETAIL_COST_COUNTRY) * 100);
BY COUNTRY

SUM RETAIL_COST_CAR  NOPRINT
    DEALER_COST_CAR  AS 'CAR TOT DCOST'  
    COMPUTE PCT2/D12.1% = ((DEALER_COST_CAR / RETAIL_COST_CAR) * 100);
BY COUNTRY
BY CAR

PRINT MODEL RETAIL_COST DEALER_COST
BY COUNTRY  
BY CAR

ON CAR SUBFOOT
 "CAR SUBFOOT <RETAIL_COST_CAR"
ON COUNTRY SUBFOOT
 "COUNTRY SUBFOOT <RETAIL_COST_COUNTRY"
WHERE COUNTRY EQ 'ENGLAND';
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
First of all thank you so much!!!

It worked very well for me... Dan, as you called that column notation is confusing yes! In my case I have around 20 fields which I have redefined and called in subtotals respectively. Thank you for your idea.

Tony - Your is simply superb!!! I think this column notation would be good if we have few or less columns. I now have two ways thank you!!!


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 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] SUBTOTAL using MULTIVERB REQUEST

Copyright © 1996-2020 Information Builders