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     [SOLVED] Putting Dates in Environment Variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Putting Dates in Environment Variables
 Login/Join
 
Platinum Member
posted
Our users are building reports in InfoAssist with date filters, but using define statements in the filter is causing some performance issues. Apparently WebFocus grabs all of the data first and then applies the define statement to each record to calculate the date even if the define doesn't use a field from the table. For example: DATEMOV(DATEADD('&YYMD', 'M' , -1 ), 'BOY')
Has anyone ever defined date variables in EDASPROF so they are already defined for InfoAssist?

thanks,
Deb

This message has been edited. Last edited by: DWaybright,


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 183 | Location: Indiana | Registered: December 05, 2017Report This Post
Virtuoso
posted Hide Post
DWaybright

The answer is yes.. You can set global ampervariable (&&} in the edasprof and then create filters in your master file that references them.

edasprof examples


-SET &&YESTERDAY=AYMD(&YYMD,-1,'I8YYMD');

-* This sets Current Year based upon Yesterday
-SET &&CYEAR=EDIT(&&YESTERDAY,'9999');

-* This sets Prior Year based upon Yesterday
-SET &&PYEAR=&&CYEAR-1;

-* This sets what the current month is based upon todays's date
-SET &&CMONTH=EDIT(&YYMD,'999999') || '01';

-* This sets 7 days prior based upon &YESTERDAY
-SET &&P7DAY=AYMD(&&YESTERDAY,-7,'I8YYMD');

-* This sets what last month is based upon today's date
-SET &&PMONTH=EDIT(EDIT(AYM(&&CMONTH, -1,'I8YYMD')),'999999$$') || '01';

-* This sets prior 6 months based upon last month - it will generate complete data
-SET &PMONTHYYM=EDIT(&&PMONTH,'999999');
-SET &&P6MONTH=EDIT(AYM(&PMONTHYYM, -6,'I6YYM')) || '01';

-* This sets prior 12 months based upon last month - it will generate complete data
-SET &PMONTHYYM=EDIT(&&PMONTH,'999999');
-SET &&P12MONTH=EDIT(AYM(&PMONTHYYM, -12,'I6YYM')) || '01';
-SET &&P24MONTH=EDIT(AYM(&PMONTHYYM, -24,'I6YYM')) || '01';


master file filter examples


FILENAME=wf_retail_time_sales, SUFFIX=SQLMSS , $
VARIABLE NAME=&&P6MONTH, $
VARIABLE NAME=&&P12MONTH, $
VARIABLE NAME=&&P24MONTH, $
VARIABLE NAME=&&CMONTH, $
VARIABLE NAME=&&PMONTH, $
VARIABLE NAME=&&YTDSTART, $
VARIABLE NAME=&&FYTDSTART, $
VARIABLE NAME=&&CYEAR, $
VARIABLE NAME=&&PYEAR, $
VARIABLE NAME=&&P7DAY, $
VARIABLE NAME=&&YESTERDAY, $
SEGMENT=DIM_TIME_SALES, SEGTYPE=S0, $
FIELDNAME=ID_TIME, ALIAS=ID_TIME, USAGE=I9, ACTUAL=I4, $
FIELDNAME=TIME_DATE, ALIAS=TIME_DATE, USAGE=I8YYMD, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Date,(Sales)',
TITLE_FR='Date,(Ventes)',
TITLE_DE='Datum,(Verkauf)',
TITLE_ES='Fecha,(Ventas)',
HELPMESSAGE='D', $
$ Year
FIELDNAME=TIME_YEAR, ALIAS=TIME_YEAR, USAGE=I6, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Year,(Sales)',
TITLE_FR='Ann?es,(Ventes)',
TITLE_DE='Jahr,(Verkauf)',
TITLE_ES='A?o,(Ventas)',
HELPMESSAGE='X', $
FIELDNAME=TIME_QTR, ALIAS=TIME_QTR, USAGE=I6, ACTUAL=I4,
MISSING=ON,
TITLE='Quarter,(Sales)',
TITLE_FR='Trimestre,(Ventes)',
TITLE_DE='Quartal,(Verkauf)',
TITLE_ES='Trimestre,(Ventas)',
HELPMESSAGE='X', $
FIELDNAME=TIME_MTH, ALIAS=TIME_MTH, USAGE=I6, ACTUAL=I4,
MISSING=ON,
TITLE='Month,(Sales)',
TITLE_FR='Mois,(Ventes)',
TITLE_DE='Monat,(Verkauf)',
TITLE_ES='Mes,(Ventas)',
HELPMESSAGE='X', $
FIELDNAME=TIME_DAY, ALIAS=TIME_DAY, USAGE=I6, ACTUAL=I4,
MISSING=ON,
TITLE='Day,(Sales)',
TITLE_FR='Jour,(Ventes)',
TITLE_DE='Tag,(Verkauf)',
TITLE_ES='D?a,(Ventas)', $
FIELDNAME=TIME_DAYOFWEEK, ALIAS=TIME_DAYOFWEEK, USAGE=I11, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Day of Week,(Sales)',
TITLE_FR='Jour de la semaine,(Ventes)',
TITLE_DE='Wochentag,(Verkauf)',
TITLE_ES='D?a de la Semana,(Ventas)', $
FIELDNAME=TIME_WEEKEND, ALIAS=TIME_WEEKEND, USAGE=A1, ACTUAL=A1,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Weekend,(Sales)',
TITLE_FR='Weekend,(Ventes)',
TITLE_DE='Wochenende,(Verkauf)',
TITLE_ES='Fin de,Semana,(Ventas)', $
FIELDNAME=TIME_HOL, ALIAS=TIME_HOL, USAGE=A1, ACTUAL=A1,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Holiday,(Sales)',
TITLE_FR='Jour f?ri?,(Ventes)',
TITLE_DE='Feiertag,(Verkauf)',
TITLE_ES='Fiesta,(Ventas)', $
FIELDNAME=TIME_YEARQTR, ALIAS=TIME_YEARQTR, USAGE=I11, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Year Quarter,(Sales)',
TITLE_FR='Trimestre de l''ann?e,(Ventes)',
TITLE_DE='Jahr Quartal,(Verkauf)',
TITLE_ES='A?o Trimestre,(Ventas)', $
FIELDNAME=TIME_YEARMTH, ALIAS=TIME_YEARMTH, USAGE=I11, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Year Month,(Sales)',
TITLE_FR='Mois de l''ann?e,(Ventes)',
TITLE_DE='Jahr Monat,(Verkauf)',
TITLE_ES='A?o Mes,(Ventas)', $
FIELDNAME=TIME_YEARWEEK, ALIAS=TIME_YEARWEEK, USAGE=I11, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Year Week,(Sales)',
TITLE_FR='Semaine de l''ann?e,(Ventes)',
TITLE_DE='Jahr Woche,(Verkauf)',
TITLE_ES='A?o Semana,(Ventas)', $
FIELDNAME=TIME_MTHNAME, ALIAS=TIME_MTHNAME, USAGE=A3, ACTUAL=A3,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Month,Name,(Sales)',
TITLE_FR='Mois,Nom,(Ventes)',
TITLE_DE='Monat,Name,(Verkauf)',
TITLE_ES='Nombre,del Mes,(Ventas)', $
FIELDNAME=TIME_DAYNAME, ALIAS=TIME_DAYNAME, USAGE=A3, ACTUAL=A3,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Day,Name,(Sales)',
TITLE_FR='Jour,Nom,(Ventes)',
TITLE_DE='Tag,Name,(Verkauf)',
TITLE_ES='Nombre,del D?a,(Ventas)', $
FIELDNAME=TIME_SHIFT, ALIAS=TIME_SHIFT, USAGE=I6, ACTUAL=I4,
MISSING=ON, ACCESS_PROPERTY=(INTERNAL),
TITLE='Shift,(Sales)',
TITLE_FR='Equipe,(Ventes)',
TITLE_DE='Schicht,(Verkauf)',
TITLE_ES='Cambio,(Ventas)', $
DEFINE SD_1/A8YYMD=EDIT( TIME_DATE ); ACCESS_PROPERTY=(INTERNAL),
TITLE='Sales Date', $
DEFINE SD_2/A8=IF SD_1 CONTAINS '2007' THEN '2012' | EDIT( SD_1, '$$$$9999' ) ELSE IF SD_1 CONTAINS '2008' THEN '2013' | EDIT( SD_1, '$$$$9999' ) ELSE IF SD_1 CONTAINS '2009' THEN '2014' | EDIT( SD_1, '$$$$9999' ) ELSE IF SD_1 CONTAINS '2010' THEN '2015' | EDIT( SD_1, '$$$$9999' ) ELSE '20140101'; ACCESS_PROPERTY=(INTERNAL), $
DEFINE SD_3/A8YYMD=SD_2; ACCESS_PROPERTY=(INTERNAL), $
DEFINE SALES_DATE_I8/I8YYMD=EDIT(SD_3); ACCESS_PROPERTY=(INTERNAL), $
DEFINE SALES_DATE/YYMD=SALES_DATE_I8;
TITLE='Sales,Date', $
DEFINE SALES_MOYEAR/MtYY=SALES_DATE;
TITLE='Sales,Month/Year',
HELPMESSAGE='TREND', $
FILTER LASTMONTH=SALES_DATE EQ &&PMONTH;
TITLE='Sales in Prior Month', $
FILTER THISMONTH=SALES_DATE EQ &&CMONTH;
TITLE='Sales in Current Month', $
FILTER P6MONTH=SALES_DATE GE &&P6MONTH AND SALES_DATE LE &&CMONTH;
TITLE='Sales in past 6 Months', $
FILTER P12MONTH=SALES_DATE GE &&P12MONTH AND SALES_DATE LE &&CMONTH;
TITLE='Sales in past 12 Months', $
FILTER P24MONTH=SALES_DATE GE &&P24MONTH AND SALES_DATE LE &&CMONTH;
TITLE='Sales in past 24 Months', $
FILTER YTDSTART=SALES_DATE GE &&YTDSTART AND SALES_DATE LE &&CMONTH;
TITLE='Calendar YTD', $
FILTER FYTDSTART=SALES_DATE GE &&FYTDSTART AND SALES_DATE LE &&CMONTH;
TITLE='Fiscal YTD', $
FILTER P7DAYS=SALES_DATE GE &&P7DAY AND SALES_DATE LE &&YESTERDAY;
TITLE='Sales in past 7 days', $
DEFINE SALES_DATE_YEAR_Y/YYMDy=DTRUNC(SALES_DATE, YEAR);
TITLE='Sales,Date,Year', $
DEFINE SALES_DATE_YEAR_Q/YYMDq=DTRUNC(SALES_DATE, QUARTER);
TITLE='Sales,Date,Y-Q', $
DEFINE SALES_DATE_YEAR_M/YYMDm=DTRUNC(SALES_DATE, MONTH);
TITLE='Sales,Date,Y-M', $

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


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by FP Mod Chuck:
DWaybright

The answer is yes.. You can set global ampervariable (&&} in the edasprof and then create filters in your master file that references them.

edasprof examples


-SET &&YESTERDAY=AYMD(&YYMD,-1,'I8YYMD');

-* This sets Current Year based upon Yesterday
-SET &&CYEAR=EDIT(&&YESTERDAY,'9999');



I thought no dash (-) before the SET in edasprof?
Thanks for the examples!!!

--Deb


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 183 | Location: Indiana | Registered: December 05, 2017Report This Post
Virtuoso
posted Hide Post
DwayBright

Depends on which SET you are doing. To set a global variable the - is required.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Platinum Member
posted Hide Post
Chuck,
Ah! Good to know. Thank you so much for your help. My users will be so pleased!

--Deb


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 183 | Location: Indiana | Registered: December 05, 2017Report This Post
Master
posted Hide Post
You can also use -INCLUDE in edasprof. We use it include several of our commonly used DEFINE FUNCTIONs so that they are always available. edasprof is just a fex. As far as I know, any syntax that is legal for a fex is legal for edasprof.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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     [SOLVED] Putting Dates in Environment Variables

Copyright © 1996-2020 Information Builders