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] Minimum date in subtotal

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Minimum date in subtotal
 Login/Join
 
Virtuoso
posted
I'm trying to get the minimum date in the subtotals per region here, but they remain blank. What's the trick?

DEFINE FILE GGSALES
	DATE1/YYMD	= DATECVT(DATE, 'I8YYMD', 'YYMD');
	DATE2/HYYMD	= HDTTM(DATE1, 8, 'HYYMD');
END
TABLE FILE GGSALES
SUM
	MIN.DATE
	MIN.DATE1
	MIN.DATE2

BY REGION
BY CITY
ON REGION RECOMPUTE MIN. DATE MIN. DATE1 MIN. DATE2
ON TABLE PCHOLD FORMAT WP
END


Output:
                                           MIN   MIN         MIN                                                                  
  Region       City                        Date  DATE1       DATE2                                                                
  ------       ----                        ----  -----       -----                                                                
  Midwest      Chicago               1996/01/01  1996/01/01  1996/01/01
               Houston               1996/01/01  1996/01/01  1996/01/01
               St. Louis             1996/01/01  1996/01/01  1996/01/01
  
  *TOTAL Midwest                                                                  
  
  Northeast    Boston                1996/01/01  1996/01/01  1996/01/01
               New Haven             1996/01/01  1996/01/01  1996/01/01
               New York              1996/01/01  1996/01/01  1996/01/01
  
  *TOTAL Northeast                                                                
  
  Southeast    Atlanta               1996/01/01  1996/01/01  1996/01/01
               Memphis               1996/01/01  1996/01/01  1996/01/01
               Orlando               1996/01/01  1996/01/01  1996/01/01
  
  *TOTAL Southeast                                                                
  
  West         Los Angeles           1996/01/01  1996/01/01  1996/01/01
               San Francisco         1996/01/01  1996/01/01  1996/01/01
               Seattle               1996/01/01  1996/01/01  1996/01/01
  
  *TOTAL West                                                                     
  
  
  TOTAL


BTW, format WP was purely used to get the output in a readable format for this forum. In reality we use format HTML.

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
DATE fields, of whichever persuasion, do not SUBTOTAL, RECOMPUTE etc.

Change to an alpha format:
DEFINE FILE GGSALES
	DATE1/YYMD	= DATECVT(DATE, 'I8YYMD', 'YYMD');
	DATE2/HYYMD	= HDTTM(DATE1, 8, 'HYYMD');
	DATE3/A10       = EDIT(EDIT(DATE),'9999/99/99');
END
TABLE FILE GGSALES
SUM
	MIN.DATE
	MIN.DATE1
	MIN.DATE2
        MIN.DATE3
BY REGION 
BY CITY
ON REGION SUBTOTAL MIN. DATE DATE1 DATE2 DATE3
ON TABLE PCHOLD FORMAT HTML
END


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
My first instinct was to use the subtotal command. But that didn't seem to work either. I'm thinking the reason is that a subtotal/recompute most likely only works on numeric values which a date is not. To get around it, I would use a subfoot

  DEFINE FILE GGSALES
	DATE1/YYMD	= DATECVT(DATE, 'I8YYMD', 'YYMD');
	DATE2/HYYMD	= HDTTM(DATE1, 8, 'HYYMD');
END
TABLE FILE GGSALES
SUM
	MIN.DATE
	MIN.DATE1
	MIN.DATE2

BY REGION
BY CITY
ON REGION SUBFOOT 
"<REGION <MIN.DATE<MIN.DATE1<MIN.DATE2"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLENCODE ON 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
	HEADALIGN=BODY,
$
END


Try this.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Member
posted Hide Post
That GGSALES example is rather misleading since the MIN.DATE value is the same for every grouping. Just SUBFOOT'ing MIN.DATE is likely giving the last value of that field, not the overall minimum. You'd have to explicitly COMPUTE the correct minimums that you want to display. Note the difference in the summary values between
TABLE FILE EMPLOYEE
SUM MIN.HIRE_DATE
BY DEPARTMENT
BY CURR_JOBCODE
ON DEPARTMENT SUBFOOT
"<DEPARTMENT <MIN.HIRE_DATE"
ON TABLE SET STYLE *
 TYPE=SUBFOOT, HEADALIGN=BODY,$
ENDSTYLE
END

and
TABLE FILE EMPLOYEE
SUM COMPUTE SUBFOOT_DATE/YMD=MIN.HIRE_DATE; NOPRINT
BY DEPARTMENT
SUM MIN.HIRE_DATE
BY DEPARTMENT
BY CURR_JOBCODE
ON DEPARTMENT SUBFOOT
"<DEPARTMENT <SUBFOOT_DATE"
ON TABLE SET STYLE *
 TYPE=SUBFOOT, HEADALIGN=BODY,$
ENDSTYLE
END


WebFOCUS 7.6.7
Linux
HTML, Excel, PDF
 
Posts: 11 | Registered: February 19, 2009Report This Post
Virtuoso
posted Hide Post
Quite so indeed.

I'll just need to change the TALBE request into a triple-verb; one for the grand-total, one for the grouped subtotals and one for the detail data.

Not exactly convenient, but quite doable. Thanks for the help, folks!

Is it worth opening an NFR for summaries on date(-time) values? It's not that common, but I doubt I'm the first person in the history of WF with the requirement.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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] Minimum date in subtotal

Copyright © 1996-2020 Information Builders