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

Why doesn't this formula work? 3

Status
Not open for further replies.

fergman

Technical User
Oct 19, 2000
91
US
So when I run this I get the "the remaining text doesn't appear to be part of this formula" error.
What I want to do is output text for a bunch of procedure codes, that's the HOSP part, but if it is HOSP I want to dump the billed amount into a global variable to report on it at the end.

Code:
Shared NumberVar TotalHOSP;
Local StringVar PLOC;

IF IsNull({Abha7105_93005.MceDtl_ProcedureCode}) Then
    TotalHOSP := TotalHOSP + {Abha7105_93005.MceDtl_BilledAmt}
AND 
    PLOC := "HOSP";

PLOC

ELSE If ({Abha7105_93005.MceDtl_ProcedureCode} = "99000" to "99999") Then
    "HOSP"
 
Right, the formula is malformed.

Stating that you want to drop something into a global variable to report on it at the end doesn't define what the end is, and you used a shared variable, not global, plus you didn't state what you intend to display in the current formula.

Try:

whileprintingrecords;
NumberVar TotalHOSP;
StringVar PLOC;
IF IsNull({Abha7105_93005.MceDtl_ProcedureCode}) or
({Abha7105_93005.MceDtl_ProcedureCode} = "99000" to "99999") Then
PLOC := "HOSP";
TotalHOSP := TotalHOSP + {Abha7105_93005.MceDtl_BilledAmt}

Showing a non-functioning formula as the basis for what you need help with is less efficient then shoiwng example data and expected output, also include your software version and the database/connectivity being used.

I took a stab here, but not knowing what you want makes it tricky.

btw, the default for a variable is global.

-k
 
My bad, sorry was getting frustrated...

crystal 10, this is a filedb connection to access.

I have a catalog of codes such as the 99000 to 99999 that I origionally had in a nice case statement, but now it is necessary to know if it is HOSP or OP or RES then add the billed amount to the end of the report (I only displayed one situation where it is blank or where it is between two numbers, but there are 30 odd codes and an OTHER for everything else). I figured I could just add a second line to each case, putting the billed amount into a viariable to display in the report footer but that is proving way more difficult.



 
Without the conditions I can't really give you the formula, but the above theory is sound, you can use a ; after the first setting of a variable, and then the results into t alocal variable for the output from the current formula.

As suggested, one is better served to show example data and the expected output, and where it is to output than talk about it.

-k
 
Here is a sample entry, county is a group, and primary lev of care is a group, sorry about the alignment, but I can't seem to get the preview to display it properly.

County: CountyName
Primary Level of Care: HOSP
AGE # % T% $
0-17: 1 1.64 0.12 1,762.00
18-29: 2 76.04 5.39 81,445.06
30-44: 1 13.85 0.98 14,839.55
45-64: 1 8.46 0.60 9,067.04
65+:
Total: 5 100 7.09 107,113.65

Obviously the $ is the billed amount, there will be identical entries after this one for OP and RES Primary level of care then the next county with the same until all counties are dealt with. all that works great. but I have to calculate the billed amount for each Primary level of care and display it at the end of the report in a lump sum.

thank you for the help by the way.
 
You might try a crosstab in the report footer which uses your primary care group field as the row and sum of billed amount as the summary.

-LB
 
lbass, you know, I think it was so simple I just didn't think about it, but that worked! lol thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top