Focal Point
Static Budget Number...How do I create this?
May 07, 2008, 09:52 AM
Rob M.Static Budget Number...How do I create this?
I have a budget/actuals report I want to create in Webfocus but I am wondering how to I create my static budget numbers in the report?
Do I use a define or something? I tried searching in WF help and here on the forum.
Rob M.
Target Corporation
WF 7.1.4
May 07, 2008, 10:19 AM
LeahExactly what do you mean by static budget numbers? Does your source file have the actual and budget amount fields in it? Are you wanting to put a 'line number' on each line of the report?
Leah
May 07, 2008, 10:26 AM
Rob M.I just want to be able to hard code a budget number for each region into the report somewhere. The budget number does not exist in any data source.
Rob M.
Target Corporation
WF 7.1.4
May 07, 2008, 10:28 AM
Rob M.I just figured it out, used a compute to create the budget field.
COMPUTE BUDGET/D6CM = IF REGION EQ '100' THEN 239400 ELSE IF REGION EQ '200' THEN 191520 ELSE IF REGION EQ '300' THEN 191520 ELSE IF REGION EQ '400' THEN 175560 ELSE 0;
Rob M.
Target Corporation
WF 7.1.4
May 07, 2008, 12:23 PM
Darin Leethat works fine. To decrease code, you could use a DECODE:
COMPUTE BUDGET/D6CM = DECODE REGION('100' 39400 '200' 191520 '300' 191520 '400' 175560 ELSE 0);
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
May 08, 2008, 09:40 AM
PBrightwellYou realize that by doing it this way you (or someone) is going to have to remember to change the program every time the budget changes. I would recommend that you put the data in a file and join to it.
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
May 08, 2008, 11:03 AM
Darin LeeI had that thought as well, but refrained from saying anything because I am guilty as well. Sometimes that's just the quickest way so Pat's comment is probably the correct/best way, but I'm not condemning Rob without knowing his whole process. (I know you're not either, Pat - thanks for the helpful tip.)
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
May 08, 2008, 05:36 PM
WazRob, I would suggest that you put the static values in a file and use DECODE
COMPUTE BUDGET/D6CM = DECODE REGION(STATBUDG ELSE 0);
Use FILEDEF to point STATBUDG to a file containig Region and Budget pairs.
Waz...Prod: | WebFOCUS 7.6.10/8.1.04 | Upgrade: | WebFOCUS 8.2.07 | OS: | Linux |
Outputs: | HTML, PDF, Excel, PPT |
In Focus since 1984 |
Pity the lost knowledge of an old programmer! |
May 09, 2008, 12:24 PM
PBrightwellDarin,
Thank you for pointing out that my response was worded a little too sternly. It was meant to be a warning rather than an admonition. I hit something similar recently. The person in this job before me retired. She had set up tables that were read in as a DECODE to convert our cost centers to Region and District. Oddly enough, I can not find a database that contains this information. One of our regions opened a new District office and used a number from an office that had closed. Our Focus/WebFocus reports were all showing the old District name. The problem was that there was a file for operations, a file for sales, a file for revenue, etc. It took me weeks to find all of the places to change this district name. I'm STILL not sure I have them all.
Rob,
The best way to handle this if the budget is based on something logical (like a percentage of last years sales) is to compute it in the program (or a program that runs annually or quarterly depending on your budget period).
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
May 12, 2008, 02:10 AM
Tony AWarren,
Decode against a file is a good alternative but will fall foul one day if the file size exceeds limits (32000 chars currently?). Joining to a file, as Pat and Darin suggest, is a little more future proof.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
May 12, 2008, 05:22 PM
WazTony, I do agree, the file was suggested as a starting point, easy to set up and maintain.
Storing in a table is better, but then requires some sort of maintenance, MODIFY, MAINTAIN, TABLE HOLD from flat file or something else.
Waz...Prod: | WebFOCUS 7.6.10/8.1.04 | Upgrade: | WebFOCUS 8.2.07 | OS: | Linux |
Outputs: | HTML, PDF, Excel, PPT |
In Focus since 1984 |
Pity the lost knowledge of an old programmer! |
May 13, 2008, 12:52 PM
cburttI suggest storing budgets and their associated keys (department, person, etc) in a fixed format 'flat' *.txt file at a fixed location, with a (hand crafted?) synonym. Update/extend the table as needed with any text editor.
The first step/task of your WebFOCUS procedure FILEDEFS to the *.txt file then copies (PRINT *) it to a FOCUS format temporary file with suitable indexes for quick retrieval.
The second step/task of the WebFOCUS procedure joins you file of actual expenses to the held file of budgets and prepares your report.
WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.