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     Subtotal / grant total / summary of a repoprt

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Subtotal / grant total / summary of a repoprt
 Login/Join
 
Gold member
posted
Hi,

how can we get the below report

Dept Div PO Cost
111 11 1 10
111 11 2 20
111 11 3 30

Total for 11 Div is 60

111 22 4 30
111 22 5 20
111 22 6 10

Total for 22 Div is 60

222 33 7 10
222 33 8 20
222 33 9 30

Total for 33 Div is 60

222 44 10 30
222 44 11 20
222 44 12 10

Total for 44 div is 60


Total for 111 dept is 120
Total for 222 dept is 120

The Grand total is 240


Thanking in advance

Navaneeth
 
Posts: 53 | Registered: October 03, 2006Report This Post
Expert
posted Hide Post
TABLE FILE filename
PRINT PO COST
BY DEPARTMENT
BY DIV SUB-TOTAL
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Ginny,
He wants to see the subtotals together: McGuyver to the rescue!


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
Navaneeth,

The McGuyver technique allows, among other nice things, to multiply your data and thus create different ways to subtotal and display.
Using your question, here is a possible solution using the GGSALES file.
  
-* File Navaneeth1.fex
SET BYDISPLAY=ON
JOIN BLANK WITH ST IN GGSALES TO BLANK IN FSEQ AS M
DEFINE FILE GGSALES
BLANK/A1 WITH ST = ' ';
XCATEGORY/A12=IF COUNTER EQ 3 THEN 'Grand Total' ELSE CATEGORY;
REGION/A12=IF COUNTER GT 1 THEN ' ' ELSE REGION;
ST/A2=IF COUNTER GT 1 THEN ' ' ELSE ST;
END
TABLE FILE GGSALES
SUM
UNITS DOLLARS
BY COUNTER NOPRINT
BY XCATEGORY AS CATEGORY
BY REGION
BY ST
ON REGION SUBTOTAL AS 'Total'
WHEN COUNTER EQ 1
ON REGION SUBFOOT
" "
WHERE COUNTER LE 3
ON TABLE NOTOTAL
HEADING CENTER
"Units and Dollars by Categories and Regions"
END


The McGuyver file has already been posted on this forum but here it is again. The master:
  
 FILENAME=FSEQ,SUFFIX=FIX,
    DATASET=C:\IBI\APPS\FOCALPOINT\FSEQ.DAT
  SEGNAME=CHAR1,SEGTYPE=S0
   FIELDNAME=BLANK,BLANK,A1,A1,$
  SEGNAME=CHARS,SEGTYPE=S0,PARENT=CHAR1,OCCURS=VARIABLE
   FIELDNAME=CHAR,CHARS,A1,A1,$
   FIELDNAME=COUNTER,ORDER,I2,I4,$

and the data - notice that it must start with a space:
  
 FILEFORMCGUYVERFILEFORMCGUYVERFILEFORMCGUYVERFILEFORMCGUYVERFILEFORMCGUYVER


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
Gold member
posted Hide Post
Hi Daniel,

I am looking into your code and i am trying to understand it, but i have a question, you have written the code based on the fact that there will be there will be only 2 Dept ( i.e. based on my example).

How can we do it if we don’t know how many dept/ Div we have, i.e. how do we achieve this same functionality at runtime.


I did look into your code, but i guess it is way above my head, can you please explain me the code.....


Thanks & Regards,
Navaneeth
 
Posts: 53 | Registered: October 03, 2006Report This Post
Virtuoso
posted Hide Post
Navaneeth,
It seems that I must take a page out of Tony's book and be less elliptic.

So, here goes.

The McGuyver file (FSEQ) allows you to read each record in your source file more than once, the number of times depending on the field COUNTER. You will notice that I have used a screening condition WHERE COUNTER LE 3, meaning that I am using 3 copies of each record.
In your example you have 3 levels: Div, Dept and a grand total.
I have reproduced the same hierarchy using GGSALES where you have REGION, CATEGORY and Grand Total. I sort my report by COUNTER, meaning that I will have first all the CATEGORYs and REGIONs, then only the CATEGORYs and finally the Grand Total.
In my DEFINE, I re-create the fields ST, REGION and CATEGORY depending on the value of COUNTER in order to achieve what you want: REGION details with subtotals, then CATEGORY totals and finally the Grand Total.
So, no, I did not base my example on the fact that you show only 2 Dept but on the fact that you have a 2-level hierarchy.
If you have more than a 2-level hierarchy increase the value of COUNTER and redefine your fields accordingly.
Do you understand?


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Subtotal / grant total / summary of a repoprt

Copyright © 1996-2020 Information Builders