Focal Point
[SOLVED] Year To Date Calculation From 2 Separate Reports

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

September 13, 2017, 03:34 PM
Johnny Aviles
[SOLVED] Year To Date Calculation From 2 Separate Reports
I have 2 reports that both the same Date Filter that I'd like to combine to one report if possible but I don't know if or how to do it.

The first report has a date parameter and displays a budget amount value for that particular date.
The second report has the same exact fields and date parameter, except displays the budget amount value for the year to date of the selected date.

I wanted to have 1 report with the Budget and Budget YTD columns next to each other since they both use the same date filter and by fields.

Has anyone encountered something similar to this or have suggestions on how to make this work? Thanks!

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1
September 13, 2017, 03:58 PM
BabakNYC
In a similar situation, instead of applying a WHERE test to the whole report, I'd use the variable to calculate a column for Budget and a different column for Budge_YTD using IF THEN ELSE.

Something like this:

BUDGET_YTD/D12.2=IF DATEFIELD GE &DATE_FIELD THEN BUDGET ELSE 0;


WebFOCUS 8206, Unix, Windows
September 14, 2017, 07:31 AM
MartinY
As Babak mentioned but a little different, something such as this

DEFINE FILE abc
BDG_DT  /P8.2C = IF RECORD_DT EQ &SELECT_DT THEN BUDGET_AMT ELSE 0;
END
TABLE FILE abc
SUM BDG_DT     AS 'Current Budget'
    BUDGET_AMT AS 'Budget YTD'
BY WHATEVER
WHERE RECORD_DT GE &BEGIN_OF_YEAR;
WHERE RECORD_DT LE &SELECT_DT;
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 14, 2017, 11:35 AM
FP Mod Chuck
Hi Johnny

Welcome to Focal Point! You will find it a great place to assist you with your WebFOCUS development...

Regards,


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 15, 2017, 02:42 PM
Johnny Aviles
Thank you everyone. That strategy did work! I was able to have a start and end date range, and display the budget, and then had a define where if the budget date = selected date it would show that value as a current date budget. I appreciate your help everyone!


WebFOCUS 8.1