Setting and using relative dates in WebFOCUS

There are times when you will want the user to be able to choose from a relative date vs. having to figure out the date or date range to select. For example, instead of picking the the first day of the current month , it would be much simpler to select the option of “Beginning of Current Month.”

The UI portion won’t be covered here; I will save that for another post. However, behind the scenes, you’ll want to add the following to your Reporting Server Profile:

-SET &&BOM=EDIT(&&YESTERDAY,’999999′) | ’01’;

What the above does is sets the global variable, &&BOM to the first day of the month.

When the user selects “Beginning of Current Month”, it will pass the value “&&BOM” to the WF content.

Here are some more calculations:

-* &YYMD is todays date




-SET &&CMTH_DATE=EDIT(&&YESTERDAY,’999999′) | ’01’;

-SET &&BOM=EDIT(&&YESTERDAY,’999999′) | ’01’;






-SET &&P6MTH=EDIT(&WS_P6MTH,’99999901′);


-SET &&LYEAR_DATE=&&LYEAR || ’01’||’01’;

-SET &&CYEAR_DATE=&&CYEAR || ’01’||’01’;







Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *