Focal Point
How to Create this Function in Web Focus 7.6.2

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

January 24, 2008, 01:39 PM
LOgle
How to Create this Function in Web Focus 7.6.2
We are currently converting reports from Bus Obj to Web Focus- I have certain functions within Bus Obj that i need to calculate Account Day Aging. For instance:

Current Date =If <=29 Then
90 Day = If Between (90 ,119) Then

I have these formulas all the way to 360 Days. Results show like this:
FinClass Cur 30 Day 60 Day
AC $235.00
AW $72,829.52 $1,678
B1 $103.40 $910.96 $195.06

Which just shows the open amounts on those day ranges. How can I create this in WebFocus.


V. 762
Windows XP
January 24, 2008, 01:48 PM
Darin Lee
Easiest way? Since they need to go in their own columns, just DEFINE a new field for each AGING bucket:

AGE_CUR/D15.2CM=IF CURRENT_DATE LE 29 THEN AMOUNT ELSE 0;
AGE_30_DAY/D15.2CM=IF CURRENT_DATE GE 30 AND CURRENT_DATE LE 59 THEN AMOUNT ELSE 0;

etc...
Then
PRINT FINCLASS
AGE_CUR
AGE_30_DAY
etc.

You could also define groups then use an ACROSS, but then you have to worry about a missing column if nothing falls in that bucket. (I know you can overcome this too, but I didn't want to include the WHOLE WF manual.)

AGE/A30=IF CURRENT DATE LE 29 THEN 'Current' ELSE
IF CURRENT_DATE LE 59 THEN '30 Day' ELSE
IF CURRENT_DATE LE 89 THEN '60 Day'
.
.
.
ELSE 'Over 360 days';

Then use ACROSS AGE


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
January 24, 2008, 01:53 PM
susannah
congratulations on your choice.
A move in the right direction.
1st, your Current_Date field looks like it should be an integer, containing a number of days rather than a Date, is that right?
So lets call it Days_Dif.
And you want to put every record into 1 of 4 buckets;
DEFINE FILE filename
BUCKET/I3=IF Days_Dif GE 120 THEN 120 ELSE
IF Days_Dif GE 90 THEN 90 ELSE
IF Days_Dif GE 60 THEN 60 ELSE
IF Days_Dif GE 30 THEN 30 ELSE 0;
...
now if you SUM AMOUNT BY FINCLASS ACROSS BUCKET
you'll get your amounts in age order, and your columns will be in the right order, the ACROSS statement will present the data in alphabetical order of the values in the BUCKET field, unless you tell it not to.

You need training. Take the classes. Download and read the manuals.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 24, 2008, 02:12 PM
mgrackin
Logle,

Welcome to WebFOCUS and Focal Point!

When you get a chance, I would like to know why you are converting BusObj reports to WF. I also support both of these products and it would be interesting to here the reasons for moving from BusObj to WF.

Since I am familiar with both products I may be able to give you some help along the way. However, there are plenty of other great folks here on FP that will help you out as well.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
January 24, 2008, 02:29 PM
GinnyJakes
Welcome aboard. We love WebFOCUS here.

If your function needs to have variable input, check out the DEFINE FUNCTION syntax. It is very cool.


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