Problem Using the Maximum Function

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Paul
Posts: 26
Joined: Tue Oct 10, 2017 12:44 pm

Problem Using the Maximum Function

Post by Paul » Thu Jan 08, 2009 12:18 pm

I have several records that have a "score" field and a "status" field. I need to choose the record with the maximum "score" and print the status code from that record along with the score. The score is numeric so I used the maximun function of the totals area which works fine, but how do you get the status code from that maximum score record to print. It seems to be printing the last records status code.

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> Problem Using the Maximum Function

Post by kfleming » Fri Jan 09, 2009 12:25 pm

MAke the maximum total preprocessed.__The create a calculated field with the expression:__IIF(SCORE=MAX, status, "")__Then create a second total that is a maximum of this calc field.__Place this new total on the footer next to the max and you should be all set.____Kathleen__R&R Support

Paul
Posts: 26
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Problem Using Maximum Function

Post by Paul » Fri Jan 09, 2009 2:33 pm

I get a syntax error trying to use Score=MAX as a calculated expression. I am using version 11.1

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Problem Using Maximum Function

Post by kfleming » Mon Jan 12, 2009 2:35 pm

I may not have been clear enough.__You need to replace MAX with the name of your preprocessed maximum total.____Kathleen__R&R Support

Paul
Posts: 26
Joined: Tue Oct 10, 2017 12:44 pm

====> RE: Problem Using Maximum Function

Post by Paul » Tue Jan 20, 2009 10:05 am

Hi Kathleen, I must be missing something. I still can^t get it to work. This is how I have it setup.____Total name- Global: Maximum(Score,Stulink,Automatic,Pre-processed,Conditional) Condition:Complink=22____Calc Field- Globalpass: IIF(Score=Global,Status,"")____Second Total Name- Globalmax:Maximum(Globalpass,Stulink,Automatic,Pre-processed)____For some reason it now prints the false return of a "blank"____The "Status" field for each record is either an "F","V" or "P"____Example: Global Score Status__ 45 F__ 60 V__ 85 P__ Maximum score is 85 should print status of a "P"

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=====> RE: Problem Using Maximum Function

Post by kfleming » Wed Jan 21, 2009 10:10 am

I think the problem may the condition on Global.__Add another calculation to the report.__Calc Field-Has22: IIF(Complink=22,Score,blanknum())__Then change Global to remove the condition and sum Has22 rather than score.__See if that causes GlobalMax to give you the correct status.____Kathleen__R&R Support____

Post Reply