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!

group selection based on formula result

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
IE
I have in detail @status:
if {Status}="A"
then "ci"
else if {Status}="I"
then "ii"
else if {Status}="S"
then "wi")

In group footer (group on J)
@statuscount:
(if {@status}="ci" then 9
else if {@status}="ii" then 8
else if {@status}="wi" then 7)

@statusmax:
Maximum ({@status}, {J})

@statusfinal – this is what I need to print
if {@statusmax}=9 then "ci"
else if {@statusmax}=8 then "ii"
else if {@statusmax}=7 then "wi"


I want to select records based of the result of the formula @statusfinal
(eg @statusfinal=“ii” and “wi”); if I try to put the condition in group selection formula I get “This formula cannot be used because it must be evaluated later”
Is there a way to do this?
Thank you very much
 
Will there only be one status per group instance? Because the way you have this set up, {@statuscount} will display in the group footer whatever is your last detail record in the group. I guess you meant {@statusmax} to be:

Maximum ({@statuscount}, {J})

It appears as though you are using the numbers to select either the highest of lowest sequence per group, when you could actually just use the value itself if you use the minimum function, since the fields would then be ordered: ci, ii, wi.The reason this is relevant is that the problem you are encountering is because you are nesting too many formulas within formulas. If I'm following you correctly, I think you could get the outcome you desire by using the following group selection formula:

{table.status} = minimum({table.status},{J})

-LB
 
Thank you.
You are right, i do have embedded formulas, this formula I wrote is just a part, but I tryed only whit this one and doesn't work, so it won't work the more complicated.
No, I can't take the status from the table. In detail there are for example 2 movements with 2 different statuses, I have to pick the last but I have no field for criteria to pick the right one(date or something), just I know which is next to another, so I can't use max or min. And then I don't write the status of the movement, I have to write the status for the job (which has more movements). For example if one movement has the status arrived and the other intransit, for the job I have to write "completed delivery", then jobs having different statuses, I have to select only the jobs which some of the statuses.
Job status being a combination of movements statuses, I can't make the selection on the movements statuses either, because I need some job which the movements could be for example intransit...and some not, so I need to use in the selection the string I write for the job.
I don't have any field in the jobs table I can base my selection on, that is why I tryed to use the strings I get.
But i guess is not possible what I want.
But now that I am writing I am thinking maybe I could write some selection formulas somehow
Thank you anyway for your reply
 
Hi
I can suppress conditionally the records I don't want
I don't know why I didn't think about this before
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top