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] Stacking totals of curr. week's values and QTD's values for a given metric?:

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Stacking totals of curr. week's values and QTD's values for a given metric?:
 Login/Join
 
Virtuoso
posted
Hi all,

So, we've been given a macro-enabled Excel sheet that shows department totals for our retail stores showing totals for the current week, then right below that totals for quarter-to-date for the sub-dept., and then the totals of all sub-departments (with those total types) below it all. For example:

Departments | Purchase Margin % | Ratio SPread % | Etc.

Meat Deli  CW | 30.30 | 8.90 | ...
          QTD | 30.30 | 26.11 | ...
Block      CW | 16.50 | 100.00 | ...
          QTD | 16.50 | 100.00 | ...
Total Meat CW | 21.85 | 20.46 | ...  <---- A subtotal/total of just the meat related sub-depts.
          QTD | 21.96 | 20.71 | ...
Produce    CW | ...
          QTD | ...
Deli       CW | ...
          QTD | ...

Total Fresh CW | ...  <---- A grand total of all sub-dept. totals.
           QTD | ...


Is there anyone here that has done something similar, and can point me in the right direction for how to implement it in code?

Any help is appreciated. Thanks!

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
Hi CoolGuy,
It's not the only way for sure 'cause with Focus there are always multiple ways Smiler

But one way could be to create one hold file per type of row having their one id, then merge them together to create the final report.
-* CREATE DETAIL ROWS
DEFINE FILE CAR
DET_ID/I3  = 100;
TOT_ID/I3  = 100;
END
TABLE FILE CAR
SUM RETAIL_COST
    TOT_ID
    DET_ID
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS DETDATA FORMAT FOCUS
END
-RUN

-* CREATE SUB TOTAL ROWS
TABLE FILE CAR
SUM RETAIL_COST
    COMPUTE TOT_ID/I3  = 200;
    COMPUTE DET_ID/I3  = 100;
BY COUNTRY
BY CAR
BY TOTAL COMPUTE MODEL /A24 = 'Car SubTotal';
ON TABLE HOLD AS STOTDATA FORMAT FOCUS
END
-RUN

-* CREATE SUB TOTAL ROWS
TABLE FILE CAR
SUM RETAIL_COST
    COMPUTE TOT_ID/I3  = 300;
    COMPUTE DET_ID/I3  = 200;
BY COUNTRY
BY TOTAL COMPUTE CAR   /A16 = '';
BY TOTAL COMPUTE MODEL /A24 = 'Country Total';
ON TABLE HOLD AS TOTDATA FORMAT FOCUS
END
-RUN

-* MERGE ALL DATA TOGETHER AND DISPLAY IN THE PROPER ORDER
TABLE FILE DETDATA
SUM RETAIL_COST
BY COUNTRY
BY DET_ID NOPRINT
BY CAR
BY TOT_ID NOPRINT
BY MODEL
MORE
FILE STOTDATA
MORE
FILE TOTDATA
END
-RUN

The result may not be that relevant, but it's the technic that is important to look at.


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
Virtuoso
posted Hide Post
Thanks Martin! Really appreciate you chiming in on this. Will play around with your code example and see where I can get from it.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
Perfect exercise for FML...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Is FML apart of WF8?? Or is that another add-on?


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Gold member
posted Hide Post
I would agree that FML could help you here. It is in WF8 as I have used it for some reporting. If you're using the GUI, you can access it in AppStudio by clicking the matrix tab at the bottom of the reporting canvas area. You'll have to define a field as the 'For Row' first. I can't seem to access the Tech Support site or I would link the FML documentation.

FML let's you do row-level calculations and reporting, useful for things like accounting roll-ups and Excel-like reporting.


WF 8.2.0.3
Windows 10 64bit
HTML, AHTML, PDF, Excel
 
Posts: 83 | Registered: April 13, 2015Report This Post
Virtuoso
posted Hide Post
capples,

I go to try and select the Matrix tab and I get a pop=up that says "FOR item does not exist."

How do I get it to exist? lol


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
Click on Technical Library at the top, select your version, search on FML...
OR, click on the Search button and type in FML...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
CoolGuy,

You will have to define a For Row first before you can use the Matrix tab. For example, you will probably have to structure your data in a way where Departments is your 'For' row and then you report on the different metrics using FML. To define the 'For' row, click the field and then from the 'Field' menu click For Row below Sort Across.

It's a little difficult to explain all the details in a forum post for FML Smiler, so if you can get to the documentation via the Technical Library, it should walk you through most of it. I would link it but like I said, the Technical Library is timing out for me when I try to access it today :\


WF 8.2.0.3
Windows 10 64bit
HTML, AHTML, PDF, Excel
 
Posts: 83 | Registered: April 13, 2015Report This Post
Virtuoso
posted Hide Post
Tom and capples,

Thank you for your help and advice. This is the first time in some time I've felt this "newbie" with WF8. I had never really understood what the Matrix tab was for or that FML was even a thing that I could use. Learned something new today!! Thank you!!! lol

I've got the docs up and am looking into this FML thing now. Also, mulling over Martin's example too.

Thank you all!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report 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] Stacking totals of curr. week's values and QTD's values for a given metric?:

Copyright © 1996-2020 Information Builders