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 write a series of focexecs that will have start dates and end dates as part of the selection critria.
This is using WebFOCUS 7.1.3.
I would like the default start date to be day 1 of the previous month of the current year and the default end date to be the last day of that month. I have found that -DEFAULT only works when you hard-code a value, such as 20070101. The variables do not translate properly when doing calculations -- the code shows rather than the value. No sytax errors, we have found this to be a consistent behavior.
The focexec is reporting off of a SQL table which has an I11 format for the date field.
So, my questions are: 1) How do I get DM to cooperate? 2) How could this be done with Java script? 4) Can the Calendar option in the HTML Painter do this?
I also have reports that need to have not only the date range for the current year, but also the same months and days in the previous year. It should be as simple as substracting 10000 from the start and end date of the current year to get the start and end dates of the previous year.
So, 4) How do I get DM to cooperate? 5) How could this be done with Java script? 6) Can the Calendar option in the HTML Painter do this?
Thanks,
John
WF 7.7.03, Windows 7, HTML, Excel, PDF
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006
John, you'll want to use the AYM and AYMD functions; Look them up in the 4th manual in your set ("Using Functions"). DM works just fine with these functions, using, for ex, the systemdate as a seed basis.
Here's an example, using &YYMD . (i prefer it to &DATE.)
Now, in your fex, you can compare a smart date to these integer forms just fine. eg, if your database date is MYDATE/YYMD then you can say IF MYDATE GE &STARTDATE or IF MYDATE FROM &STARTDATE TO &ENDDATE and it works just dandy. This takes care of your questions 1 and 4 (you'll be able to figure out last year the same way)
-SET &THISDAYLY=&YYMD - 10000 ;
...etc
You say you're comparing to an I11 formatted field...I don't know what is in your I11... and why its 11 and not 8, but you can figure it out from here, i'm sure. Give it a try.
Questions 2 and 3 your best bet is a .js forum. Questions 3 and 6, beats me, sorry. I'll defer to a gui person.
-S.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
-SET works fine. However, -DEFAULT is where the problem lies. It only seems to work when hardcoding a value for the start or end date for that I11 field. Otherwise it displays the expression. How can I get -DEFAULT to work?
I was told the reason for the I11 "date" field is it was from some old legacy application.
WF 7.7.03, Windows 7, HTML, Excel, PDF
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006
ah...i see. yes you're right. you can't DEFAULT to an &VAR..won't work. you need to do this in 2 steps.. -DEFAULT for the user input dates then -SET for the variable you're actually going to use in your filters. -SET &STARTDATE= ... what we did above using &YYMD -DEFAULT &USERSTART= 00000000 ; ... this sets an empty value for a user-supplied date..and if it is empty or still 00000000 at run time, then use the calculated &STARTDATE else override with the User-supplied date. ...now compare the 2 -SET &STDATE = IF &USERSTART IS 00000000 THEN &STARTDATE ELSE &USERSTART ; and your filter is IF MYDATE GE &STDATE ... i do this sort of thing with a variable called &LAUNCH. it is set to &LAUNCH='DEFAULT' when the user hits my page for the first time; then from my paramter launch page i have a hidden variable LAUNCH=LIVE ; i then control all my filters on whether LAUNCH = DEFAULT or not. ... does that I11 date look like this: 00020070725 ?? ... but as Alan says, in your particular example, you're always calculting a startdate from the &YYMD..so you don't really need to default anything?This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
i tried that code, Francis, in both 5 and 7, and i got nada. i got the character string &WSTARTDATE.EVAL as the content of &STARTDATE. how did you make it work?
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
When the command procedure is executed, the expression is replaced with the value of the specified variable before any other action is performed. Without the .EVAL operator, a variable cannot be used in place of some commands.
And I found this in the IBI supplied samples:
C:\ibi\apps\ibinccen\hrlist2.fex
-DEFAULTS &SORTBY = &DIMENSION.EVAL
(Just finished watching the Colbert Report)
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
was he good tonight? post oscars, must have been. razzing JohnStewart. ok, so why can't i make it work? i copied your code, pasted it, and ran it. 5 and 7. boy, would i like to use it, if i could. When i run, my autoprompt screen shows inside the boxes , the character string &WENDDATE.EVAL Do you see that?This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Using the parameter prompting of XMLPROMPT for IBIF_wfdescribe will prompt for &variables started with a -DEFAULTS. Setting this to XMLRUN will stop that behaviour.
For some reason, not aligned to autoprompt, and I cannot remember why, I stopped using -DEFAULTS quite a while back, and just used -SET. So for this type of scenario I would use:
Where &STARTDATE could be supplied by the user or not. This would be compatible with having auto-prompt set for XMLPROMPT. On that note also, I cannot find a single instance of me having used .EVAL. Different folks, different strokes.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
I just tried the code in MRE with Prompt for Parameters set to on and it does not work. I hadn't tested this as the original question did not mention MRE.
Sorry about that.
I do know some programmers that have too many .EVAL cards in their back pockets, but I have had occasion to use .EVAL.
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
-DEFAULT &STARTDATE = &YYMD.EVAL ; works fine for me now its in unix don't know if that makes a difference. but it won't work in a launch form the launch form displays the string '&YYMD.EVAL' which ain't too swell.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003