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.
I am working on a report with lot of calculations in it. I completed most part of it and am at the ending where I need to calculate YTD and MTD. Data is like this. Can someone help me how to do this?
Data is this format above. Date is in YYM format. For each VAL based on DATE field, I need to calculate YTD and MTD of T1, T2 and P%. How do I do this?
Thanks in advance.This message has been edited. Last edited by: Kerry,
If you get 0 years & 0 months. Use IF Condition to bump up the value. ( I guess you might have to implement this logic for rest of Year, Month counts).
Hope this helps.
Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
Posts: 82 | Location: Chicago | Registered: September 28, 2005
If I understand this correctly you want 2 new columns for t1(YTD), t2(YTD) & p%. Leaving the p% column out of this for now since perhaps you are computing this percentage against some other field you can compute the YTD using LAST
SUM T1
COMPUTE
T1_YTD/D5M = T1 + LAST T1_YTD ;
BY VAL
BY DATE
END
well it would seem that you want a report by period reprsnting all of the periods within the current year. That will include the valuew for that period (t1 and t2) plus columns representing their cumulative YTD totals through that period (which is the compute I provided previously). The way I understand your requirements T1 is MTD and the compute would be YTD.
SUM T1 AS 'MTD_T1'
COMPUTE
T1_YTD/D5M = T1 + LAST T1_YTD ; AS 'YTD_T1'
BY VAL
BY DATE
TABLE FILE TABLENAME
SUM
T1 OVER
T2 OVER
T3 OVER
T4
BY STATE
BY CITY
ACROSS DATE_YYMM
END
DATE_YYMM (in format YYMM) has 4 months of data (till date), I get 4 columns. But I need only 2 columns with MTD (only 2010/04 data) and YTD (sum of all 4 months data) values for all 4 fields (T1, T2, T3 and T4). Hope this makes sense..
so put in som DM and a DEFINE. Lets assume you want current month MTD and YTD through the current month
-* THIS WILL SET THE CURRENT PERIOD
-SET &PERIOD = EDIT(&YYMD,'999999') ;
-SET &YRSTART = EDIT(PERIOD,'999901') ;
DEFINE FILE MyFile
T1_MTD/D12 = IF DATE_YYMM EQ '&PERIOD' THEN T1 ELSE 0 ;
END
TABLE FILE MyFile
IF DATE_YYMM FROM '&YRSTART' TO '&PERIOD'
SUM T1_MTD AS 'MTD'
T1 AS 'YTD'
BY whatever
end