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] Rolling 12 Periods (dynamic based on data)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Rolling 12 Periods (dynamic based on data)
 Login/Join
 
Member
posted
I'm in InfoAssist and trying to create a filter that will calculate a rolling 12 mths or periods. I'm having trouble calculating the periods/mths.

For example, my data set has two periods/mths for 2015 and twelve for 2014. I need to be able to filter for my current year two periods/mths and then only return the previous year period/mth three to twelve.

I have a define to create the current year and previous year using the &DATEYY parameter.

Thanks,
Trevor

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


WF 8.0.08
 
Posts: 19 | Location: Calgary, AB | Registered: July 09, 2014Report This Post
Virtuoso
posted Hide Post
May not be the only way to do it 'cause there are multiple way with Focus, but here one:
-SET &CUR_YYM = EDIT(EDIT(&DATEYYM, '9999$99'));
-SET &12MTHS_AGO_YYM = AYM(&CUR_YYM, -12, 'I6YYM');
-TYPE CURRENT_YYMM= &CUR_YYM  12MTHS_AGO = &12MTHS_AGO_YYM

Then use
&CUR_YYM
and
&12MTHS_AGO_YYM
in your WHERE such as
TABLE FILE ...
PRINT TBL_YYM
BY TBL_YYM
WHERE TBL_YYM GE &12MTHS_AGO_YYM;
WHERE TBL_YYM LE &CUR_YYM;
END


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
Member
posted Hide Post
Hi Martin.

I should have specified that I only have a year field and a separate month number field.

I also must be able to do this in the InfoAssist application and not dev/app studio.

Thanks,
Trevor


WF 8.0.08
 
Posts: 19 | Location: Calgary, AB | Registered: July 09, 2014Report This Post
Virtuoso
posted Hide Post
Maybe something like this:
DEFINE FILE ...
TBL_YYM /I6 = TBL_YY * 100 + TBL_MM;
CUR_YYM /I6 = EDIT(EDIT(&DATEYYM, '9999$99'));
12MTHS_AGO_YYM /I6 = AYM(CUR_YYM, -12, 'I6YYM');
END
TABLE FILE ...
PRINT TBL_YYM
BY TBL_YYM
WHERE TBL_YYM GE 12MTHS_AGO_YYM;
WHERE TBL_YYM LE CUR_YYM;
END


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
Member
posted Hide Post
BRILLIANT!!!

Slight mod on the CUR_YYM.
CUR_YYM / I6 = &DATEYY * 100 + &DATEM;

Works great!!! Thanks very much Martin.


WF 8.0.08
 
Posts: 19 | Location: Calgary, AB | Registered: July 09, 2014Report This Post
Virtuoso
posted Hide Post
My pleasure Wink


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
  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] Rolling 12 Periods (dynamic based on data)

Copyright © 1996-2020 Information Builders