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 check if an amper variable has data to it or not. I have some reports which are scheduled monthly and they can also be run by users at their convenience (to get historical data). The reports need begin date and end date as parameters. I have calculated the begin date and the end date of the current month using the &MDYY command and am feeding these values as input to the where conditions. As the reports are run monthly, the report caster job is working fine.
However my users also want to run these reports at their convenience from a launch page (occasionally). When they give a historical begin and end date, they are being overwritten by the calculated begin and end dates and the report is not running for the desired months.
Is there a way so that when the users run the report, the report picks the dates given by them and if no input is provided, picks the calculated begin and end dates.
Any suggestions will be helpful.
Thanks for reading.
SumantThis message has been edited. Last edited by: sumant,
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
If user supplied a value for &date_parameter, it sails through the -DEFAULT statement unchanged. If not, the calculated 'default' values gets assigned. The -SET ensures that &date_parameter will be impervious to any -DEFAULT encountered downstream, perhaps within a -INCLUDE
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I tried the method suggested by j.gross. However when prompted, the string &calculated_start_date.EVAL is being printed. The date should be printed but the exact string is being printed here. I am coding in MRE and tried a few other examples. I cant DEFAULT to an &variable.
Thanks, Sumant
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
In your suggestion, the user's date wil always trump the calculated date. The BOM and EOM dates have already been calculated using system date and are being used as input to the where clauses. If the users want to input their dates, the where clauses should pick the user's dates else pick the already calculated BOM and EOM dates.
Thanks, Sumant
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
When I comment the -SET command in prgram 1 and run it, the text "&calculated_start_date.EVAL" is being printed instead of the date given in program 2. I was going through some old posts in this forum, and saw a post similar to this which said the -DEFAULT does not work well in MRE.
When I run the same procedure in Data Servers, it works absolutely fine.
Thanks, Sumant
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
These code examples work for me on MRE as well. Here they are in the context of GGSALES
-SET &RC_START_DATE='19960101';
-SET &RC_END_DATE='19961231';
-DEFAULT &START_DATE=&RC_START_DATE;
-DEFAULT &END_DATE=&RC_END_DATE;
-SET &START_DATE=&START_DATE;
-SET &END_DATE=&END_DATE;
TABLE FILE GGSALES
SUM
GGSALES.SALES01.DOLLARS
BY LOWEST GGSALES.SALES01.DATE
WHERE ( GGSALES.SALES01.DATE GE &START_DATE.EVAL ) AND ( GGSALES.SALES01.DATE LE &END_DATE.EVAL );
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
You could also do something goofy like this, if you don't trust DEFAULT.
The below example just checks to see if there is already a value for the date parameters. It's not as elegant as using DEFAULT.
[CODE] -SET &START_DATE=IF &START_DATE EQ '' THEN 19960101 ELSE &START_DATE; -SET &END_DATE=IF &END_DATE EQ '' THEN 19961031 ELSE &END_DATE; [CODE]
Similarly, you could try to determine if the report was coming from MRE, and, if so, ignore the calculated values.