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 created a *.fex that, based on today’s date, will generate a 1 line report to let us know what the current, previous and last fiscal year is. Pretty basic.
How can I use these returned values in a subsequent report? I feel like in the subsequent report I want to set up some Define variables that equal the 3 returned variable – but I’m struggling how to do this. I did create a Hold file where it wrote the data to a SQL Server table in the webFOCUS database – but I was not sure “what” to do with it once it was there – as there’s no master file for the hold file. (See new to webFOCUS comment above)
In the 2nd report – I then tried to do an Include of the first report – as I thought I could then get my 3 variables to show up by setting up some defines on what I think is the hold table….but I’m not seeing my hold table. I also looked at creating a “Define Function” to do this – but those appear to not work with tables/dynamic data.
I could use a little nudge in the right direction.
Here’s the fex code for my one liner:
DEFINE FILE F0008_TEMP ADD CurrentFiscalYear/P9=CDFY + 2001; FiscalBegin/MDYY=DATECVT((CDDFYJ + 1900000)/1000,'YY','YYMD')+IMOD(CDDFYJ,1000,'I8') - 1; TESTING_DATE/I10=20120401; TESTING_DATE_I/I8YYMD=TESTING_DATE; daCurDT/I8YYMD=DATECVT(&YYMD, 'I8YYMD','YYMD'); curMonth/M=DATECVT(daCurDT, 'I8YYMD', 'M'); curFiscialPeriod/I2=IF curMonth LE '3' THEN curMonth + 9 ELSE curMonth -3; PreviousFiscalYear/P9=CDFY + 2000; LastFiscalYear/P9=CDFY + 1999; END TABLE FILE F0008_TEMP PRINT F0008_TEMP.F0008_TEMP.FiscalBegin F0008_TEMP.F0008_TEMP.CurrentFiscalYear F0008_TEMP.F0008_TEMP.PreviousFiscalYear F0008_TEMP.F0008_TEMP.LastFiscalYear curFiscialPeriod daCurDT BY HIGHEST 1 F0008_TEMP.F0008_TEMP.CDFY WHERE F0008_TEMP.F0008_TEMP.CDDTPN EQ 'E'; WHERE F0008_TEMP.F0008_TEMP.FiscalBegin LE &DATEMDYY.QUOTEDSTRING; ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE HOLD AS H2O_TEST FORMAT XML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty, $ ENDSTYLE ENDThis message has been edited. Last edited by: stur0063,
webFOCUS 8207.15 WindowsServer 2019
Posts: 120 | Location: Minnesota | Registered: August 26, 2013
Welcome to the Forum! Freebie for a Newbie! It is the Season... This will give you some ideas; & are local, valid through the report, && are global, valid throughoiut the session... Use as you see fit:
ENGINE SQLORA SET DEFAULT_CONNECTION PROD
SQL SQLORA PREPARE SQLOUT_D FOR
SELECT *
FROM DUAL
END
-*******************************************************************************
DEFINE FILE SQLOUT_D
-* System Date
-*DATEX/YYMD WITH DUMMY = '2012/10/01';
DATEX/YYMD WITH DUMMY = '&DATEYYMD';
DATE1/I8YYMD = DATEX;
DATE2/A4 = DOWK(DATE1,DATE2);
DATE3/YYMD = IF DATE2 EQ 'SAT' THEN DATEX + 2 ELSE
IF DATE2 EQ 'SUN' THEN DATEX + 1 ELSE DATEX;
WCD/MDYY WITH DUMMY = DATE3;
-* Day Current
DAY/MDYY WITH DUMMY = '&DATEMDYY';
DCA/Wtr = DATEX;
-* Work Day - Prior/Next
WPD/MDYY = DATEMOV(WCD,'PWD');
WND/MDYY = DATEMOV(WCD,'NWD');
-* Business Day - Prior/Next
BPD/MDYY = DATEMOV(WCD,'PBD');
BND/MDYY = DATEMOV(WCD,'NBD');
-* Work Week - Current/Prior/Next
WCS/MDYY = DATEMOV(WCD,'BOW');
WCE/MDYY = DATEMOV(WCD,'EOW');
WPS/MDYY = WCS-7;
WPE/MDYY = WCE-7;
WNS/MDYY = WCS+7;
WNE/MDYY = WCE+7;
-* Month - Current/Prior/Next
MCS/MDYY = DATEMOV(WCD,'BOM');
MCE/MDYY = DATEMOV(WCD,'EOM');
MPS/MDYY = DATEADD(MCS,'M',-1);
MPE/MDYY = DATEMOV(MPS,'EOM');
MNS/MDYY = DATEADD(MCS,'M',+1);
MNE/MDYY = DATEMOV(MNS,'EOM');
-* Month Numeric - Current/Prior/Next
MCN/M = WCD;
MPN/M = MCN-1;
MNN/M = MCN+1;
-* Period - Current/Prior/Next
PCN/M = DATEADD(WCD,'M',+6);
PPN/M = PCN-1;
PNN/M = PCN+1;
-* Quarter - Current/Prior/Next
QCS/MDYY = DATEMOV(WCD,'BOQ');
QCE/MDYY = DATEMOV(WCD,'EOQ');
QPS/MDYY = DATEMOV(DATEADD(WCD,'M',-3),'BOQ');
QPE/MDYY = DATEMOV(DATEADD(WCD,'M',-3),'EOQ');
QNS/MDYY = DATEMOV(DATEADD(WCD,'M',+3),'BOQ');
QNE/MDYY = DATEMOV(DATEADD(WCD,'M',+3),'EOQ');
-* Quarter - Period (Adjusted for Fiscal Year)
QCN/Q = DATEADD(WCD,'M',+6);
QPN/Q = QCN+3;
QNN/Q = QCN+9;
-* Fiscal Year - Current/Prior/Next
FCN/YY = IF DATEADD(WCD,'M',0) LT 7 THEN WCD ELSE DATEADD(WCD,'M',+6);
FPN/YY = FCN-1;
FNN/YY = FCN+1;
FC2/Y = FCN;
FP2/Y = FCN-1;
FN2/Y = FCN+1;
-* Fiscal Year - Current/Prior/Next
FCS/MDYY = DATEADD(DATEMOV(WCD,'BOY'),'M',-6);
FCE/MDYY = DATEADD(DATEMOV(WCD,'BOY'),'M',+6)-1;
FPS/MDYY = DATEADD(FCS,'M',-12);
FPE/MDYY = DATEADD(FCE,'M',-12);
FNS/MDYY = DATEADD(FCS,'M',+12);
FNE/MDYY = DATEADD(FCE,'M',+12);
END
-*******************************************************************************
TABLE FILE SQLOUT_D
PRINT
DCA AS 'Day,Current,Alpha'
WCD AS 'WorkDay,Today,Numeric'
WPD AS 'WorkDay,Prior,Numeric'
WND AS 'WorkDay,Next,Numeric'
BPD AS 'BusinessDay,Prior,Numeric'
BND AS 'BusinessDay,Next,Numeric'
WPS AS 'Week,Prior,Monday'
WPE AS 'Week,Prior,Friday'
WCS AS 'Week,Current,Monday'
WCE AS 'Week,Current,Friday'
WNS AS 'Week,Next,Monday'
WNE AS 'Week,Next,Friday'
MPS AS 'Month,Prior,1stDay'
MPE AS 'Month,Prior,LastDay'
MCS AS 'Month,Current,1stDay'
MCE AS 'Month,Current,LastDay'
MNS AS 'Month,Next,1stDay'
MNE AS 'Month,Next,LastDay'
MPN AS 'Month,Prior,Integer'
MCN AS 'Month,Current,Integer'
MNN AS 'Month,Next,Integer'
PPN AS 'Period,Prior,Numeric'
PCN AS 'Period,Current,Numeric'
PNN AS 'Period,Next,Numeric'
QPS AS 'Quarter,Prior,1stDay'
QPE AS 'Quarter,Prior,LastDay'
QCS AS 'Quarter,Current,1stDay'
QCE AS 'Quarter,Current,LastDay'
QNS AS 'Quarter,Next,1stDay'
QNE AS 'Quarter,Next,LastDay'
QPN AS 'Quarter,Prior,Numeric'
QCN AS 'Quarter,Current,Numeric'
QNN AS 'Quarter,Next,Numeric'
FPN AS 'FiscalYear,Prior,Year'
FCN AS 'FiscalYear,Current,Year'
FNN AS 'FiscalYear,Next,Year'
FP2 AS 'FiscalYear,Prior,Year2'
FC2 AS 'FiscalYear,Current,Year2'
FN2 AS 'FiscalYear,Next,Year2'
FPS AS 'FiscalYear,Prior,1stDay'
FPE AS 'FiscalYear,Prior,LastDay'
FCS AS 'FiscalYear,Current,1stDay'
FCE AS 'FiscalYear,Current,LastDay'
FNS AS 'FiscalYear,Next,1stDay'
FNE AS 'FiscalYear,Next,LastDay'
BY DUMMY NOPRINT
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-*******************************************************************************
-READ HOLD &DCA.A1. &WCD.A8. &WPD.A8. &WND.A8. &BPD.A8. &BND.A8. &WPS.A8. &WPE.A8. &WCS.A8. &WCE.A8. &WNS.A8. &WNE.A8. &MPS.A8. &MPE.A8. &MCS.A8. &MCE.A8. &MNS.A8. &MNE.A8. &&MPN.A2. &&MCN.A2. &&MNN.A2. &&PPN.A2. &&PCN.A2. &&PNN.A2. &&QPS.A8. &&QPE.A8. &&QCS.A8. &&QCE.A8. &&QNS.A8. &&QNE.A8. &&QPN.A1. &&QCN.A1. &&QNN.A1. &&FPN.A4. &&FCN.A4. &&FNN.A4. &&FP2.A2. &&FC2.A2. &&FN2.A2. &&FPS.A8. &&FPE.A8. &&FCS.A8. &&FCE.A8. &&FNS.A8. &&FNE.A8.
-SET &&DCA = DECODE &DCA(1 'Monday' 2 'Tuesday' 3 'Wednesday' 4 'Thursday' 5 'Friday' 6 'Saturday' 7 'Sunday');
-SET &&WCD = EDIT(&WCD,'99/99/9999');
-SET &&WPD = EDIT(&WPD,'99/99/9999');
-SET &&WND = EDIT(&WND,'99/99/9999');
-SET &&BPD = EDIT(&BPD,'99/99/9999');
-SET &&BND = EDIT(&BND,'99/99/9999');
-SET &&WPS = EDIT(&WPS,'99/99/9999');
-SET &&WPE = EDIT(&WPE,'99/99/9999');
-SET &&WCS = EDIT(&WCS,'99/99/9999');
-SET &&WCE = EDIT(&WCE,'99/99/9999');
-SET &&WNS = EDIT(&WNS,'99/99/9999');
-SET &&WNE = EDIT(&WNE,'99/99/9999');
-SET &&MPS = EDIT(&MPS,'99/99/9999');
-SET &&MPE = EDIT(&MPE,'99/99/9999');
-SET &&MCS = EDIT(&MCS,'99/99/9999');
-SET &&MCE = EDIT(&MCE,'99/99/9999');
-SET &&MNS = EDIT(&MNS,'99/99/9999');
-SET &&MNE = EDIT(&MNE,'99/99/9999');
-SET &&MPA = DECODE &&MPN(01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June'
- 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December');
-SET &&MCA = DECODE &&MCN(01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June'
- 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December');
-SET &&MNA = DECODE &&MNN(01 'January' 02 'February' 03 'March' 04 'April' 05 'May' 06 'June'
- 07 'July' 08 'August' 09 'September' 10 'October' 11 'November' 12 'December');
-SET &&QPS = EDIT(&&QPS,'99/99/9999');
-SET &&QPE = EDIT(&&QPE,'99/99/9999');
-SET &&QCS = EDIT(&&QCS,'99/99/9999');
-SET &&QCE = EDIT(&&QCE,'99/99/9999');
-SET &&QNS = EDIT(&&QNS,'99/99/9999');
-SET &&QNE = EDIT(&&QNE,'99/99/9999');
-SET &&FPS = EDIT(&&FPS,'99/99/9999');
-SET &&FPE = EDIT(&&FPE,'99/99/9999');
-SET &&FCS = EDIT(&&FCS,'99/99/9999');
-SET &&FCE = EDIT(&&FCE,'99/99/9999');
-SET &&FNS = EDIT(&&FNS,'99/99/9999');
-SET &&FNE = EDIT(&&FNE,'99/99/9999');
-? &