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.
We're on WebFOCUS 8201 and I'm in AppStudio trying to supply a calculated default value (the last day of the previous month) to a filter parameter (&KEYDATE), so report users can accept that freshly-calculated default value or choose to overwrite it before running the report.
I thought it'd be pretty straightforward, using the -SET command and some date math to calculate the previous EOM variable, formatting the result as MM/DD/YYYY, and then supply that to a -DEFAULT command situated just prior to the report to be run:
TABLE FILE A_ACCT_DEPOSIT_DLY SUM A_ACCT_DEPOSIT_DLY.DEPOSIT_ACCOUNT_DAILY.DLY_BAL/D12.2CM AS 'SVG_BAL1' BY LOWEST A_ACCT_DEPOSIT_DLY.MEMBER.MBR_NUM AS 'MBR_NUM' WHERE ( A_ACCT_DEPOSIT_DLY.DATE_EFFECTIVE.DTE EQ '&KEYDATE.EVAL' ) AND (( A_ACCT_DEPOSIT_DLY.PRODUCT.PROD_TYPE_CD EQ 'SV' ) OR ( A_ACCT_DEPOSIT_DLY.PRODUCT.PROD_ID EQ 'CKG280' ) OR ( A_ACCT_DEPOSIT_DLY.PRODUCT.PROD_ID EQ 'CKG281' )) AND ( A_ACCT_DEPOSIT_DLY.MEMBER.IS_MBR_FLAG EQ 'Y' ) AND ( A_ACCT_DEPOSIT_DLY.BALANCE_STATUS.BAL_STAT EQ 'Active' ) AND (( A_ACCT_DEPOSIT_DLY.MEMBER.MBR_CLASS_CD GE '100' ) AND ( A_ACCT_DEPOSIT_DLY.MEMBER.MBR_CLASS_CD LE '199' )); ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty, $ ENDSTYLE END
When I uncomment the -TYPE command and test the date math, it returns what I'd hope (a value of 12/31/2017). But when I run the procedure, the filter parameter displays not the calculated value, but the character string '&DT3.EVAL' (without the quotes).
Can techniques along these lines be used to supply a calculated value to the -DEFAULT command? Is there some modest tweak I can make to get the scripting above to work? I sure appreciate any insights!
Dale Davaz daled@stcu.orgThis message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8.2
Posts: 9 | Location: Spokane, WA | Registered: December 13, 2016
Thanks, Francis. I worried that might be the case. I'll supply a simple string as the default to at least serve as a format example, but that may be the best that's possible.
No luck going the route suggested by jfr99, I'm afraid. Try as I might, only line 002 gets read and rendered (though I may not have implemented his idea properly).
I'll check back on this thread as I can over the next few days, but I'll figure for now that I've ventured into the tall grass with this exploration.
All the same, runtime-calculatable parameter defaults sure seem like they'd be a nice feature to have, if the powers that be cared to take a swing at supporting them! :-)
--Dale
WebFOCUS 8.2
Posts: 9 | Location: Spokane, WA | Registered: December 13, 2016
David, I'm hoping to have report users engage an HTML page and be prompted with a filter parameter box that invites them to supply the date that'll be used by the filter in the report. I'd like to "seed" that field with a calculated default value equal to the last day of the previous month, whatever that figures out to be, given the runtime date. But users should be able to overwrite that default value, also.
Doug, ultimately the date that users are being asked to submit should be in the format MDYY... but I can manipulate other formats into the proper one, if necessary. Yes, we're using the WebFOCUS report server interface, so folks are interacting with an HTML page to submit inputs for parameters.
Thanks for your interest in this question!
--Dale
WebFOCUS 8.2
Posts: 9 | Location: Spokane, WA | Registered: December 13, 2016
TABLE FILE SYSTABLE PRINT NAME NOPRINT COMPUTE DEF_DATE/MDYY = DATEMOV(DATEADD(DATECVT(&YYMD,'I8YYMD','MDYY'),'M',-1),'EOM'); WHERE RECORDLIMIT EQ 1 ON TABLE SET HOLDLIST PRINTONLY ON TABLE PCHOLD FORMAT XML END
And then in your launch page via App Studio, you can make an explicit call to this fex (in Settings for your date parameter) and get the value from DEF_DATE.
Then in the Parameters tab ... bind DEF_DATE to your calendar control
This will pre-load that control with the last day of the previous month but still allow your user to select a different date.
Hope this helps.
WebFocus 8.201M, Windows, App Studio
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008
Even if one can't use a variable to supply a value to the -DEFAULT WebFOCUS command and keep matters quite that simple, you rightly point the way to binding a custom control whose default value comes from an external .fex and leverage that in a more sophisticated HTML application context.
I'll absolutely roll up my sleeves and take a swing at that approach at my next opportunity.
I really appreciate everyone's quick responses!
--Dale
WebFOCUS 8.2
Posts: 9 | Location: Spokane, WA | Registered: December 13, 2016