Page 1 of 1
Problem Using the Maximum Function
Posted: Thu Jan 08, 2009 12:18 pm
by Paul
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.
=> Problem Using the Maximum Function
Posted: Fri Jan 09, 2009 12:25 pm
by kfleming
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
==> RE: Problem Using Maximum Function
Posted: Fri Jan 09, 2009 2:33 pm
by Paul
I get a syntax error trying to use Score=MAX as a calculated expression. I am using version 11.1
===> RE: Problem Using Maximum Function
Posted: Mon Jan 12, 2009 2:35 pm
by kfleming
I may not have been clear enough.__You need to replace MAX with the name of your preprocessed maximum total.____Kathleen__R&R Support
====> RE: Problem Using Maximum Function
Posted: Tue Jan 20, 2009 10:05 am
by Paul
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"
=====> RE: Problem Using Maximum Function
Posted: Wed Jan 21, 2009 10:10 am
by kfleming
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____