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> Coding Question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
<SOLVED> Coding Question
 Login/Join
 
Master
posted
The user is prompted for a Period whose format is: YYYYMM. Ex: 201207 = July 2012. I need to recode the month of the period to a fiscal month. Ex: 201207 = July 2012 = Fiscal Month 1 of 2012.

HOW CAN I DO THIS? there are no tables involved at this point. Instead of using the prompted parameter for period down the road, I need a new item I can use: FiscalMonth.

Sounds simple but I am unsure how to get started...An EDIT wrapped around the period then evaluate the month---07 = 1, 08 = 2 etc?...not really sure how to do that....

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


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
This won't help you in WF 7.6, but some time in WF 7.7x several Fiscal (Financial) functions were added, like FIYR, FIQTR...

The easiest way to deal with this Dialogue manager variable is with IF-ELSE statements or a DECODE statement, or you could create your own Fiscal function(s).

-SET &PERIOD = '201207';

-*------------------------------------------------------------------------------

-SET &PERIOD_Y = EDIT(&PERIOD, '9999$$');
-SET &PERIOD_M = EDIT(&PERIOD, '$$$$99');

-SET &FPERIOD_M = DECODE &PERIOD_M (
- '01' '07',
- '02' '08',
- '03' '09',
- '04' '10',
- '05' '11',
- '06' '12',
- '07' '01',
- '08' '02',
- '09' '03',
- '10' '04',
- '11' '05',
- '12' '06',
- ELSE '??');

-SET &FPERIOD_Y = IF &PERIOD_M GE '07' THEN &PERIOD_Y + 1 ELSE &PERIOD_Y;

-SET &FPERIOD = &FPERIOD_Y || &FPERIOD_M;

-TYPE &PERIOD / &FPERIOD


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
THANK YOU. I had part of it last night but got hung up on the syntax for the DECODE.

The next question is can I use: FPERIOD_M in a DEFINE?

I have a horizontal table with columms:
FY
Period1Amount
Period2Amount
.
.
.Period12Amount


Essentially I want to define and item:
NEWAMOUNT: If FPERIOD_M = 1 then Period1Amount
ELSE IF FPERIOD_M = 2 then Period1Amount+Period2Amount etc etc.

I don't see the item: FPERIOD_M avaialble in the list when I try to do a define for the table though....


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Something like:
DEFINE FILE abc
FPERIOD_M /A2 = "&FPERIOD_M.EVAL";
NEWAMOUNT /P7 = IF FPERIOD_M EQ "01" THEN Period1Amount ELSE IF FPERIOD_M EQ "02" THEN Period1Amount+Period2Amount ELSE ...;
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
Virtuoso
posted Hide Post
As the fiscal period is just 6 months behind calendar year, it is simpler to use AYM rather than decodes and IF..THEN..ELSE
-SET &INDATE = 201207;

-SET &FPERIOD_Y = EDIT(AYM(&INDATE,-6,'I6YYM'),'9999$$');
-SET &FPERIOD_M = EDIT(AYM(&INDATE,-6,'I6YYM'),'$$$$99');

-TYPE &FPERIOD_Y
-TYPE &FPERIOD_M


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Thats neat! I thought there would be issues with a period of 201201...period = -05???...but apprently that function somehow knows how to factor that in...it came up with: 06...I'll have to read up on that one!


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 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> Coding Question

Copyright © 1996-2020 Information Builders