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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula & Summary Problems

Status
Not open for further replies.

jdaily

Technical User
Jan 19, 2004
53
US
Hi!

Running CRW 8.0 Developer and pulling from MS Access 2000.

I have a report that I am trying to selectively exclude specific data from two particular groups (billing errors and coding issues) within the report. There is a total of 6 different groups (I mean in preview, not design).

I am having a problem with getting the correct count of the accounts viewed and the correct totals.

In the detail section under format and suppress I have the following formula to get distinct acct #'s:

CODE................
{Payment_Info.acct_num} = previous({Payment_Info.acct_num}) or

If {Do_Not_Use_-_Denial_Codes.responsible_dept} in [ "Billing Errors", "Coding Issues" ] and
{Patient_Information.fin_class} in [ "K", "Q" ] Then
True
Else
False;
END CODE.............

I am new to coding so bear with me.

I have a second detail section that has no formulas in the format section but I do have formulas for each of the 5 different fields that I have and the summaries are built off of these.

Here is the count formula:

CODE...............
Global numbervar CountAcctNum;

If Not({Do_Not_Use_-_Denial_Codes.responsible_dept} in [ "Billing Errors", "Coding Issues" ] and
{Patient_Information.fin_class} in [ "K", "Q" ]) Then
CountAcctNum := CountAcctNum + 1;
END CODE...........

Here is the total charges formula:

CODE...............
Global CurrencyVar SumTotChgs;

If Not({Do_Not_Use_-_Denial_Codes.responsible_dept} = [ "Billing Errors", "Coding Issues" ] and
{Patient_Information.fin_class} = [ "K", "Q" ]) Then
SumTotChgs := {Payment_Info.total_charges};
END CODE...........

I have tried doing distinct count from the database, doesn't do anything to the numbers. I've tried putting the formulas from the detail a section into the detail b, didn't work.

I am at a loss.

Basically I am trying to keep fin_class K and Q out of the groups Billing Errors and Coding Issues.

Any help is greatly appreciated!

Thanks,

John
 
Keep in mind that some example data and a representation of the expected output will paint a much clearer picture than descriptions of data and expected output.

Place this code in the report->edit selection Formula->Record

not(
{Do_Not_Use_-_Denial_Codes.responsible_dept} in [ "Billing Errors", "Coding Issues" ] and
{Patient_Information.fin_class} in [ "K", "Q" ]
)

That eliminates those rows.

Now for your sum it appears that you want to only count some unique values for {Payment_Info.acct_num}.

You didn't share where you're displaying sums, or any groupings in the report, so I'll make this generic:

Group Header 1
@resetsum formula
whileprintingrecords;
numbervar TheSum:=0;

Detail formula
@SumNumber formula
whileprintingrecords;
if {Payment_Info.acct_num} <> previous({Payment_Info.acct_num}) then
numbervar TheSum:=TheSum+{Payment_Info.total_charges};

Group Footer 1
@DisplaySum formula
whileprintingrecords;
numbervar TheSum

The variable TheSum now has the aggregate where acct_num isn't the same as the previous

You might also just group at acct_num and display the field directly in it's header or footer if all you need is to see one of the values.

Hope this helps.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top