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.
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:
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.....
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, 2006