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

Field >= Sun@Formula 1

Status
Not open for further replies.

CrystaLv

Technical User
May 12, 2006
121
US
I have fields

ID Stage
1 Finished
1 NC
1 NULL
2 Finished
2 NC
2 NULL
2 Finished


I wrote formula StageStatus
If isnull{table.stage} or {table.stage}='Finished' then 1 else0

Then I am inserting field SUM@StageStatus
and I am getting result:
ID Finished
1 2
2 3
This Report is done.

Now they want reversed version where there is
Promised >= Finished.
Promised is a Number field.
However Finished is SUM of the StageStatus formula.
How do I go with :
selecr data where Promised>= SUM@StageStatus???

Result I am looking for:
ID Promised Finished

2 3 3



Thanks for all help
 
If Promised is a field that is the same for all details, then you could go to report->selection formula->GROUP and enter:

maximum({table.promised},{table.ID}) >= sum({@stagestatus},{table.ID})

-LB
 
Nothing have changed since I've entered formula.
I am not sure If Promised is a field that is the same for all details? All fields are grouped by {table.ID} and are in this group.
Report has anly Group1 where all info is.

Thanks

P.S. I will play with an idea of course.
 
Place {table.promised} in the detail section and observe how it behaves in relation to {@stage}. Please show some sample data at the detail level and include group subtotals, too.

-LB
 
ID Stage Promised
1 Finished 3
1 NC 3
1 NULL 3 it is the same per each ID

2 Finished 2
2 NC 2
2 NULL 2
2 Finished 2

When I group by ID I am getting

ID Promised
1 3
2 2

'Finished' gets calculated as @StageStatus
If isnull{table.stage} or {table.stage}='Finished' then 1 else0
So I am getting
ID Promised Finished
1 3 2
2 2 3

Because Finished should be >= than Promised I need to end up

ID Promised Finished
2 2 3

I hope I clarified. Thanks
 
You are now saying the opposite of what you said at first about whether you want to show groups where promised is greater than or less than finished. If you want to only show those groups where finished is >= promised, then use this group selection formula:

maximum({table.promised},{table.ID}) < sum({@stagestatus},{table.ID})

-LB
 
maximum({table.promised},{table.ID}) <= sum({@stagestatus},{table.ID})
worked for me.
Sorry I am confusing you. The way my data is i am working like with mirror image. This is why at some point i do not comprehend what i am saying. I will be watching next time. So far I am done with stuff for 3 departments. Thanks to your help and everyone elses. You are the best and i couldn't probably get it without you. Happy 4th everyone!
Oops!or happy weekends!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top