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]Counter Based On Start & End Date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Counter Based On Start & End Date
 Login/Join
 
Member
posted
Hello All,

I'm having some difficulty with some code and need some assistance.

I need to create a counter/grouping in a DEFINE based on a Start Date and End Date to place into an ACROSS.

Example:
Start Date: 2015/10/15
End Date: 2016/02/15

2015/10 = 1
2015/11 = 2
2015/12 = 3
2016/01 = 4
2016/02 = 5

Any assistance will be greatly appreciated.

TIA

This message has been edited. Last edited by: <Emily McAllister>,
 
Posts: 5 | Registered: May 17, 2016Report This Post
Virtuoso
posted Hide Post
Could be one way to do it
DEFINE FILE GGSALES
DTEYM /YYM = DATE;
END
TABLE FILE GGSALES
SUM UNITS
BY DTEYM
BY TOTAL COMPUTE ID /P3 = IF DTEYM EQ LAST DTEYM THEN ID ELSE ID + 1;
BY STCD
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN

TABLE FILE TMP
SUM UNITS
BY STCD
ACROSS ID
ACROSS DTEYM AS ''
END
-RUN


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
Sounds like a candidate for the McGyver technique.

Or, if you're reporting on an RDBMS that supports recursive CTE's or that has generator functions (or both), you could do it in SQL (using SQL passthru).

Especially the CTE's are fun queries to write, but you need to get your head in the right mode to understand how that recursion works.


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
Master
posted Hide Post
How about using RANKED BY Start Date?

Run the request and hold the result and you will have a new field called RANK that you can subsequently use as you please.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Gold member
posted Hide Post
TABLE FILE SWI
SUM VOLUME
BY TIME_TIME_HIERARCHY_WEEK
WHERE TIME_TIME_HIERARCHY_WEEK GE '&START_DATE';
WHERE TIME_TIME_HIERARCHY_WEEK LE '&END_DATE';
ON TABLE HOLD
END

DEFINE FILE HOLD
NEWSORT/I1=IF TIME_TIME_HIERARCHY_WEEK NE LAST TIME_TIME_HIERARCHY_WEEK THEN LAST NEWSORT + 1 ELSE 1;
END

TABLE FILE HOLD
SUM VOLUME
ACROSS NEWSORT
END


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 74 | Registered: December 23, 2013Report This Post
Member
posted Hide Post
Thank You for everyone's reply...the stakeholder dropped the requirement I needed the counter for from the report.

Thanks for all the great suggestions.


WebFocus 8.1.05
 
Posts: 5 | Registered: May 17, 2016Report 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]Counter Based On Start & End Date

Copyright © 1996-2020 Information Builders