When a parameterized report is scheduled, you can set the value of a parameter to a variable, rather than a literal value. This ability reduces the need for a schedule to be updated before it is run. For example, instead of editing a schedule daily in order to display up-to-date information, a report can be scheduled to always display the date of the day that it is running. This is done by setting the value of the parameter as &YYMD. In the Task Parameters dialog box, there is a check box labeled The value contains a system variable, as shown in the following image.
This check box is cleared by default. When this check box is selected, a string beginning with the ampersand character is processed as a variable. When this check box is cleared, the ampersand character is then processed as a literal value. This feature works with both system variables, and global variables that have been set in the Reporting Server global profile edasprof.prf.
The following syntax is a sample report procedure (FEX) that contains date parameter values that can be used with the &YYMD Variable.
-*COMPONENT=Define_wf_retail DEFINE FILE retail_samples/wf_retail Sale_Date/YYMD='&Sale_Date.Sale Date: Use &|YYMD in Schedules.' ; Last_Year/YYMD=Sale_Date - 365 ; Two_Years_Ago/YYMD=Last_Year - 365 ; Quantity/D12.2=IF WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Sale_Date THEN WF_RETAIL.WF_RETAIL_SALES.QUANTITY_SOLD ELSE 0 ; Prior_Year/D12.2=IF WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Last_Year THEN WF_RETAIL.WF_RETAIL_SALES.QUANTITY_SOLD ELSE 0 ; Two_Years_Past/D12.2=IF WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Two_Years_Ago THEN WF_RETAIL.WF_RETAIL_SALES.QUANTITY_SOLD ELSE 0 ; END ENGINE INT CACHE SET ON SET PAGE-NUM=NOLEAD SET SQUEEZE=ON -DEFAULTH &WF_HTMLENCODE=ON; SET HTMLENCODE=&WF_HTMLENCODE SET HTMLCSS=ON -DEFAULTH &WF_EMPTYREPORT=ON; SET EMPTYREPORT=&WF_EMPTYREPORT -DEFAULTH &WF_SUMMARY='Summary'; -DEFAULTH &WF_TITLE='WebFOCUS Report'; TABLE FILE retail_samples/wf_retail SUM Sale_Date AS 'Sale,Date' Quantity AS 'Quantity Sold' Last_Year AS 'Last,Year' Prior_Year AS 'Quantity Sold,Last Year' Two_Years_Ago AS 'Two,Years,Ago' Two_Years_Past AS 'Quantity Sold,Two Years Ago' BY WF_RETAIL.WF_RETAIL_GEOGRAPHY_STORE.BUSINESS_REGION WHERE (WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Sale_Date) OR (WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Last_Year) OR (WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE EQ Two_Years_Ago); ON TABLE SUBHEAD "&Company.Company Name: Use Widgets&|More in Schedules." ON TABLE PCHOLD FORMAT HTML ON TABLE NOTOTAL ON TABLE SET CACHELINES 100 ON TABLE SET GRWIDTH 1 ON TABLE SET STYLE * INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENIADefault_combine.sty,$ TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, SUMMARY=&WF_SUMMARY.QUOTEDSTRING, ORIENTATION=LANDSCAPE, HFREEZE=OFF, $ TYPE=TABHEADING, LINE=1, JUSTIFY=CENTER, $ TYPE=TABHEADING, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=14, STYLE=BOLD+ITALIC, $ ENDSTYLE END
Open a domain or folder in your WebFOCUS Repository. In the Create New pane, click More, and then click Text Editor.
Copy and paste the syntax example above into the text editor and save the file.
As shown in the following image, the Widgets&More company report distributed on March 27th, 2018 shows the number of items sold on March 27th, 2018, 2017, and 2016.