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 need to extract the month as I2 field and the year as an I4 field. I need this based on the current date. Ex: if today is 07/29/2014, I need to extract Month = 7 and Year = 2014. Month and Year should be intergers. I have had luck in the past with:
However I am not sure how to apply this to the system date (or what the appropriate & varaiable for the system date is) or if these functions are even applicable.This message has been edited. Last edited by: RobertF,
Now the next problem. I am updating several fexes. They all start with the same DEFAULT and said default is referenced in a WHERE condition later on. There are 10 or so of these grap/report fexes all rendered via an HTML launch page. We want to get away from the hard coded FYCURRENT shown below:
APP HOLD foccache -DEFAULT &FYCURRENT = 2014;
I am tasked with eliminating the hard coded value. It needs to be replaced with a variable...something along these lines:
IF &DATEM GE 8 AND &DATEM LE 12 THEN &DATED + 1 ELSE &DATED;
I am unsure how to do this. Do I create a define and set the default to that...I had no success. Can I set the default directly? Again no success.
As System Date is a kind of constant, you can simply use Dialog MAnager in order to get your values.
example :
-SET &YEAR = &DATEYY ; will provide 2014 as YEAR value.
-SET &MONTH = &DATEM ; will provide 07 for july but
-SET &MONTH = &DATEM + 0 ; will provide 7 for july.
The same is also valid for the day :
-SET &DAY = &DATED + 0 ; in order to get 1 or 30 for the day.
Using Dialog manager is faster than doing a TABLE with RECORDLIMIT in order to read values in a file.
Rgds,
Patrick
8207, Windows 2016 64b, HTML, AHTML, PDF, EXL07...
Posts: 27 | Location: Suresnes | Registered: August 26, 2010
All, I need to have DEFAULTS set for various reasons. Technically there may be others ways to do this, but I have numerous fexes already set up in this manner. I really need to derive the default value.
I just tried this: -DEFAULT &FYCURRENT = &DATEYY.EVAL ;
It did not work. Upon execution of a fex, the parameter boxes pop up with my default values for various parameters. The default for FYCURRENT is NOT 2014 but rather the text: &DATEYY.EVAL . That does not yield an error until: RUN is hit on the paramter screen. Then the code that generates the first hold file yields this error:
0 NUMBER OF RECORDS IN TABLE= 2037 LINES= 2037 0 ERROR AT OR NEAR LINE 36 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: &DATEYY.EVAL 0 ERROR AT OR NEAR LINE 63 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: &DATEYY.EVAL (FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND
Here is the basic code structure. Note the DEFAULTS are in place in order to be able to get into the advanced graphing tool…plus it made testing easier when originally developed. Further we are still undecided as to whether we want the user selecting a year or not. Note that when run in production, the HTML launch page prompts for values that override the defaults. Fo now, we simply no longer want the user to select a Fiscal Yea, we want to derive the value to be in effect based on the month we are in.
Fo now, we simply no longer want the user to select a Fiscal Yea, we want to derive the value to be in effect based on the month we are in.
Clarification...RE: Fo now, we simply no longer want the user to select a Fiscal Year, we want to derive the value to be in effect based on the month we are in.
Once I get the FYCURRENT default to derive the year from the current date's year, I plan to maninulate the date on the current month we are in....I'll worry about that later.
this is strange, what about testing by removing the WHERE based on the date and adding a heading in order to display the value ? just add an -EXIT after your TABLE.
Try to add ' ' in the default
Add a .EVAL to each &FYCURRENT in your WHERE
I don't have anymore 7.6 release available.
Rgds,
8207, Windows 2016 64b, HTML, AHTML, PDF, EXL07...
Posts: 27 | Location: Suresnes | Registered: August 26, 2010
-SET &FYCURRENT = IF &DATEM GE '08' THEN &DATEYY + 1 ELSE &DATEYY;
-SET &FYPREVIOUS = &FYCURRENT - 1;
WHERE J1.TBLMSTR_CALENDARPERIOD.FISCALYEAR IN (&FYCURRENT, &FYPREVIOUS);
And, if FISCALYEAR is really an ALPHA then:
WHERE J1.TBLMSTR_CALENDARPERIOD.FISCALYEAR IN ('&FYCURRENT.EVAL', '&FYPREVIOUS.EVAL');
Ehhhh! All this apparently works for report selection and I have learned quite a bit but...it falls apart once I get to the html launch page.
The reason the FYCURRENT parameter is there is apparently to limit subsequent parameter values the user may choose...ie we have CHAINING in effect and require FYCURRENT (year) for that.
So, bottom line, the user need not see the parameter: FYCURRENT but it needs to be there to control the chained values they see for subsequent prompts....and we want to derive it as opposed to them selecting it.
Again, the trick really is how to get the default value for FYCURRENT derived and fed to the parameter box.
How can this be so complicated? All I really want to do is say something like this:
DEFAULT FYCURRENT =IF &DATEM GE 8 AND &DATEM LE 12 THEN &DATED + 1 ELSE &DATED;
I did a little testing, and it appears you can only -DEFAULT to a static value. Since you want the default year to vary on your HTML page, what about using Javascript in the onInitialUpdate function of your page? In more recent versions of WebFOCUS, there is a function called IbComposer_setCurrentSelection to do this, but there are other ways to do this with Javascript, depending on the type of control you are using for the year.
I can try that but if the FY is in effect in one table (fex) and populates a parameter but the other parameters are in another table populating the remaining parameters...I am unsure the chaining will work...will try though
HA! Well I created a fex that yeild the year I want. I pointed my parameter to it on the html screen. I left my other parametrs point towards the other data source. I crossed my fingers that somehow it would all magically work and chain.
Well, the FYCURRENT poulates with the right year now!
Sadly, the other 3 parameters do not show up at all!