[Dataperf] Is there a better way of doing this?
chrispedersen at hotmail.com
Thu Aug 3 21:02:47 CEST 2017
I'm sure this was answered previously.
Created an index on the number of votes.
Create a field for the ordinal position he finished (1, 2, 3, 4, 5.. or alternately (more difficult) first, second, third)
Create a report based on the index.
Insert N into Ordinal field.
N=N+1.. rinse repeat till end of file.
Now alternately, if you wanted this field to update all the time (don't have to manually run report), you could create a subpanel based off the index. You would also need a cascade trigger on the master panel.
ie., Master Panel records has an data link to the subpanel. Something like "VotesChanged" Y/N. Which links to all subpnel records. When the record changes, it would trigger a recalc on the ordinal numbering.
More or less, ralph's book had a section on this, iirc. Conceptually it is similary to line items on an order. He used a recursive link to increment the ordinal number.
From: Dataperf <dataperf-bounces at dataperfect.nl> on behalf of Tim Rude <timrude at hotmail.com>
Sent: Thursday, April 13, 2017 5:47 PM
To: dataperf at dataperfect.nl
Subject: Re: [Dataperf] Is there a better way of doing this?
Assuming you want the position displayed as a field on their record, I think (given that you're dealing with historic info that isn't going to change) I'd consider creating a non-user-editable field on that panel and then I'd create a report that populates that field for each record. Run the report once and all of the records are updated. If you add new historic records, run the report again. Maybe not as spiffy as having the field update on the fly, but seems like it could be easier to implement.
On 4/13/2017 10:45 AM, Don Friedman wrote:
I have a panel with the vote counts of a handful of candidates from past elections entered and a total of the votes cast with a computed field telling me what each candidate's percentage of the vote was in that particular district. What I'm looking for is a way to indicate what each candidate's position was in the race in that district - someone came in first, second, third, and etc.
I am envisioning writing very long formulas to accomplish this but am wondering if anyone can think of a better way of getting there.
PRS Data Systems
205 S Main Street
Pittsburgh, PA 15215
Dataperf mailing list
Dataperf at dataperfect.nl<mailto:Dataperf at dataperfect.nl>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dataperf