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

A string is required here 1

Status
Not open for further replies.

azoe

Technical User
Feb 21, 2005
175
US
With this formula I get the error: A string is required here, and it highlights the second IF.

The EvenSplitName formula is simply 'Even Split' and that's all.

Have I broken some rule or is there a syntax error?

Thank you -



If
(isNull({dch_MonthlyPmtsWithSIMandDept;1.Rendering})
or
{@EvenSplitCalc1} = True)
Then {@EvenSplitName}

Else
If
{@RenderingCondition} = True
Then {dch_MonthlyPmtsWithSIMandDept;1.Rendering} in ["Name1 Here", "Name2 Here"]
 
I could guess at what field type rendering is, but that seems to be the culprit.

It might also be that {@RenderingCondition} is a string, in which case checking for true would cause the error.

In either case, you need to post what you're trying, referencing unknown formulas will likely net more posts, not solutions.

So any field that is a string, must be checked against a string, and if the first part of the formula returns a string, so must the other potential outputs.

Try wrapping all of the outs in totext() that aren't strings.

-k

-k

 
Hi,
it looks like your formula is outputting {@EvenSplitName} which is fine but the next if is then checking again for other values rather than outputting a value. Normally it would go:

If field=value then 'Good value'
else if field=value2 then 'bad value'
else 'other value'

What are you trying to do with the formula ?
ShortyA
 
The problem is that if your first condition is met, the result will be a String ({@EvenSplitName}), but if the second condition is met, the result is a Boolean ({dch_MonthlyPmtsWithSIMandDept;1.Rendering} in ["Name1 Here", "Name2 Here"]) - hence the error.

If you describe your intent, perhaps someone can offer up an alternate formula.

-dave
 
When I looked again, I see that the problem is that the ELSE condition is returning a boolean rather than a string (checking for an IN condition returns True/False, not a string).

Try

If
(isNull({dch_MonthlyPmtsWithSIMandDept;1.Rendering})
or
{@EvenSplitCalc1} = True)
Then {@EvenSplitName}

Else
If
{@RenderingCondition} = True
and
{dch_MonthlyPmtsWithSIMandDept;1.Rendering} in ["Name1 Here", "Name2 Here"]
then
"It's rendering"

Adjust as required.

-k
 
Ultimately I want to come up with total figures per doctor (not as easy as adding all values for one field per doctor).
Right now I have the records grouped according to how the money is figured. For instance Referring doctors get a certain percent under certain conditions (such as what department or service code is on the charge record).

The problem is that now I need a way to find a total for each doctor. Say in the first group all the rendering doctors get 100%. Then in the 2nd group all the referring doctors get 100% and so on. So at the end I want to add up DoctorA's figures from group 1, 2, 3, and 4.

I'm guessing one thing to do (I'd like to do the easiest thing - and this is all I've thought of so far) is to make the first group (Group 1) the doctor names. Does that make sense - or is there an easier way?

So I'm trying to come up with a formula to do that.
Each record has a rendering doctor and a referring doctor.

Rendering is a varchar field.

One thing I've tried in another version(copy) of the report
is to add a crosstab because the departments are supposed to be in columns and they want the doctor names in rows and then in the cell is a total from each group like described above - but the totals aren't right so I was thinking I'm not done grouping - therefore the formula I'm working on now).
I'm not sure if I've told you enough or too much.

Thank you -
 
synapsevampire: Oh, I didn't realize that returned a boolean. Thanks for that -

Then I could list them one at a time like this unless there's an easier way:

If
(isNull({dch_MonthlyPmtsWithSIMandDept;1.Rendering})
or
{@EvenSplitCalc1} = True)
Then "Even Split"

Else
If
{@RenderingCondition} = True
And {dch_MonthlyPmtsWithSIMandDept;1.Rendering} = "DoctorA"
Then "DoctorA"

Else
If
{@RenderingCondition} = True //only get rendering

And {dch_MonthlyPmtsWithSIMandDept;1.Rendering} = "DoctorB"
Then "DoctorB
 
More simply:

If (isNull({dch_MonthlyPmtsWithSIMandDept;1.Rendering})
or
{@EvenSplitCalc1} = True)
Then "Even Split"
Else
If {@RenderingCondition} = True then{dch_MonthlyPmtsWithSIMandDept;1.Rendering}

-k
 
Oh my goodness. I seem to try and make things more complicated than need be. I thank you. Now I can find out if this will help me get those totals. :)
Thanks and have a great day -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top