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] MTD and YTD totals

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MTD and YTD totals
 Login/Join
 
Silver Member
posted
Can somebody help me to understand why this query is not calculating MTD and YTD totals correctly? If I run two separate queries I get count of 2(MTD) and 3(YTD). The query shows the same count for both MTD and YTD.


DEFINE FILE MOVIES
RELYEAR/YY = RELDATE;
END

TABLE FILE MOVIES
SUM
CNT.MOVIECODE AS 'YTD'
WHERE RELYEAR EQ 1989;
SUM
CNT.MOVIECODE AS 'MTD'
WHERE ( RELDATE GE '1989/12/01' ) AND ( RELDATE LE '1989/12/31' );
END

Thank you,

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


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report This Post
Expert
posted Hide Post
Check out this post. I hope it helps...

BTW: You're running this all for the same timeframe...

I'll post some code after I work on it a bit...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Here's a Freebie:
DEFINE FILE MOVIES
RELYEAR/YY = RELDATE;
RELMONTH/M = RELDATE;
END
TABLE FILE MOVIES
HEADING
"Summary"
"movies released"
"by Year and Month"
SUM CNT.MOVIECODE AS 'YTD'
BY RELYEAR AS 'Year' SUBTOTAL
BY RELMONTH AS 'Month'
WHERE RELDATE IS-FROM '1988/01/01' TO '1991/12/31' ;
ON TABLE SET PAGE OFF
END
Enjoy it... Good night...




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Silver Member
posted Hide Post
Doug,
Thank you for the quick reply.

I wanted to show count for the current month and year NOT the count for each month and subtotal for the year. I just modified the query(below) to show you what I am trying to do. I want the report by current month and year but there are no current data in our sample GGSALES DB so I hardcoded the values assuming current year=1997 and current month = 12.

Result shows counts are the same for YTD and MTD but they are not. Any ideas how to do this?

DEFINE FILE GGSALES
SALEYEAR/YY = DATE;
SALYRMTH/YM = DATE;
END

TABLE FILE GGSALES
SUM
CNT.UNITS AS 'YTD'
BY REGION
BY STCD
WHERE SALEYEAR EQ 1997;
SUM
CNT.UNITS AS 'MTD'
BY REGION
BY STCD
WHERE SALYRMTH EQ 199712;
END

Result should show as below:

Region Store ID YTD MTD
Midwest R1019 180 15


Thanks,


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report This Post
Gold member
posted Hide Post
JJ,

I get your desired results this way:

DEFINE FILE GGSALES
SALEYEAR/YY = DATE;
SALYRMTH/YM = DATE;
YTD_UNITS/I11C MISSING ON = IF ( SALEYEAR EQ '1997' ) THEN 1
ELSE MISSING;
MTD_UNITS/I11C MISSING ON = IF ( SALYRMTH EQ '199712' ) THEN 1
ELSE MISSING;
END

TABLE FILE GGSALES
SUM
YTD_UNITS AS 'YTD'
MTD_UNITS AS 'MTD'
BY REGION
BY STCD
END

-mary


WF 7.6.10, Windows, PDF, Excel
 
Posts: 75 | Location: Dallas, TX | Registered: February 12, 2004Report This Post
Silver Member
posted Hide Post
Mary - Thank you.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
 
Posts: 47 | Registered: April 22, 2009Report 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] MTD and YTD totals

Copyright © 1996-2020 Information Builders