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     [SOLVEDCalculating a date to serve as the default filter parameter value for a report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVEDCalculating a date to serve as the default filter parameter value for a report
 Login/Join
 
Member
posted
Hi everyone,

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:

quote:

-SET &DT1 = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'M', -1),'YYMD','I8YYMD');
-SET &DT2 = DATECVT(DATEMOV(DATECVT(&DT1,'I8YYMD','YYMD'),'EOM'),'YYMD','I8YYMD');
-SET &DT3 = EDIT(&DT2,'$$$$99')|'/'|EDIT(&DT2,'$$$$$$99')|'/'|EDIT(&DT2,'9999');

-* -TYPE &DT3

-DEFAULT &KEYDATE = &DT3.EVAL;

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.org

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2
 
Posts: 9 | Location: Spokane, WA | Registered: December 13, 2016Report This Post
Platinum Member
posted Hide Post
How about something like this ...

-*
-DEFAULT &KEYDATE = '.'
-*
-TYPE -----------------
-TYPE YYMD ------------ &YYMD
-TYPE KEYDATE --------- &KEYDATE
-TYPE -----------------
-IF NOT (&KEYDATE EQ '.' OR ' ') GOTO :USE_DATE ;
-SET &KEYDATE = FPRINT(DATEMOV(DATEADD(DATECVT(&YYMD,'I8YYMD','MDYY'),'M',-1),'EOM'),'MDYY','A10');
-TYPE ** CALCULATE NEW KEYDATE **
-:USE_DATE
-TYPE KEYDATE --------- &KEYDATE
-TYPE -----------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Expert
posted Hide Post
WHERE ( A_ACCT_DEPOSIT_DLY.DATE_EFFECTIVE.DTE EQ '&KEYDATE.EVAL' )


Try removing the .EVAL here, you don't need it.


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
Expert
posted Hide Post
I've time-machined back to v7.7.05 and lost my v8 memory, but I don't think this is kosher any more:

-DEFAULT &KEYDATE = &DT3.EVAL;


I don't think you can set a -DEFAULT to a variable...


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
Member
posted Hide Post
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, 2016Report This Post
Master
posted Hide Post
Is your requirement to set &KEYDATE to value of &DT3 in Dialogue Manager?

If so you would want to use a -SET command.

Something like:
 -SET &KEYDATE = &DT3;  
 
Posts: 822 | Registered: April 23, 2003Report This Post
Expert
posted Hide Post
What date format do you want? Are you using an HTML page to pass the parameters in?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
Thanks for chiming in, David and Doug.

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, 2016Report This Post
Platinum Member
posted Hide Post
You can create a new fex like this ...

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, 2008Report This Post
Member
posted Hide Post
Thanks for that additional insight, jfr99!

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, 2016Report 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     [SOLVEDCalculating a date to serve as the default filter parameter value for a report

Copyright © 1996-2020 Information Builders