Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab Formula Problem

Status
Not open for further replies.

jdaily

Technical User
Jan 19, 2004
53
0
0
US
Running v8.5 on XP connecting to an Oracle database.

I have a formula that is totaling most of the data correctly. I am trying to take the total from the previous quarter, 20062, and multiply that result to get the estimated total for the current quarter, 20063. The quarters are string fields. I am putting this total formula, called @Display, in a Crosstab, as a summary field, that is in the Report Header section.

Here is how I have my formulas set up:

@Initialize
whileprintingrecords;
global Numbervar QtrEstimate;

If ({CLM.QUARTER} = "20062") Then
QtrEstimate := {@Total};

The @Initialize is placed in the Group Quarter.

@Display
If Not({CLM.QUARTER}="20063") Then {@Total} Else

If ({@Family} = "DrugName1") and ({CLM.QUARTER}="20063") Then
{@Total}*(1-.011)
Else If ({@Family} = "DrugName2") and ({CLM.QUARTER}="20063") Then
{@Total}*(1-.032)

The @Display is placed in the detail section.

When I look at the detail it computes correctly. In the crosstab it is taking the total for 20063 and multiplying the percentages by that number and giving me a result. I need it to multiply the percentage against the previous quarter total to give me an estimate for this quarter.

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top