Focal Point
[CLOSED] Date formula in Selection Criteria of Report Assistant

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/534100573

February 19, 2010, 11:34 AM
benji
[CLOSED] Date formula in Selection Criteria of Report Assistant
First off, let me say the I am a newbie whn it comes to WebFOCUS, so please bear with me if the answer is obvious.

I have a report that I created in Report Assistant. In the selection criteria for a date field, I have the criteria set to a constant, and the report works fine. The date field is in YYMD format, so I have the constant set to 20100219, for example, to run it for 2/19/2010. What I would like to do is set the report to run for a dynamic date, three days less than the current date. So if today is 2/19/2010, I would like it to run for 2/16/2010, or 20100216. How would I go about setting that up?

I tried adding a formula field to the Field Selection that finds the date that is three days prior to the current date. Then I set the Selection Criteria of the date field to the Field that I created rather than a constant. I don't believe it is working correctly, however, because I could not get it to return results -- report usuallly takes 30 seconds to a minute to return results, but it ran for half an hour and still did not return anything when I set it up that way.

Any help would be appreciated!

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


WebFOCUS 7.6.4
Windows XP
.txt, Excel, etc.
February 19, 2010, 11:45 AM
GinnyJakes
If you do it that way, Benji, the date compare is not being passed to the backend data base (what is it BTW?). You actually have to compare to an amper variable that you have to calculate before the report part then change your WHERE to compare the field to the variable.

To calculate the new date, you must use a function and Dialogue Manager, e.g.
-SET &DAYS_3=AYMD(&YYMD,-3,'I8YYMD');
then
WHERE datefield EQ &DAYS_3

Now you might have to add slashes or dashes to the variable depending on the format of the date in your data base. You would use the EDIT funtion to do that:
-SET &DATE_3=EDIT(&DAYS_3.'9999-99-99');

You are going to have to do some of this in the editor, not the RA.

Good luck.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 19, 2010, 01:29 PM
benji
Thanks for the info. How exactly do I get to the Dialog Manager to make these changes?


WebFOCUS 7.6.4
Windows XP
.txt, Excel, etc.
February 19, 2010, 01:34 PM
GinnyJakes
quote:
You are going to have to do some of this in the editor, not the RA.

Right-click the program and choose text editor. Then you have to type in the code.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 19, 2010, 01:39 PM
benji
I don't seem to have the Text Editor option in the list when I right-click on the report. It would be in the same list that I see the Report Assistant option, right? I wonder if it privilege-based thing, and perhaps I don't have the right permissions.


WebFOCUS 7.6.4
Windows XP
.txt, Excel, etc.
February 19, 2010, 02:34 PM
GinnyJakes
Well, I'm not am MRE wiz but based on your description, you are trying to do this in Reporting Objects. I think if you look at your program in My Reports, you should be able to use the text editor.

Or you need more privileges. Check with your WebFOCUS admin.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google