Locking and sorting columns

This is what I am trying to do:
Lock the information in column A so it always stays there (1st, 2nd , 3rd, etc.)
Sort Column C (total winnings) in descending order and keep the coresponding participants (column B ) with the amount.
Create a value in Column D (4 behind Leader) that shows the difference between C3 and C4, C3 and c5, etc.
The amounts and names are  filled from another sheet and change weekly. I can sort based on total winnings and the names follow. I can also create a formula to show the difference between the Leader and the next place participant however when I do a sort based on Total Winnings after the new values each week the Place and $Behind Leader always shift up and down. The information in Column A seems "locked" to the information in Columns B and C. The refernce in Column D is always Chris's amount and I want it to be refenced to the 1st place Participant.
I hope I've explained this.
Thanks - James
2013 Standings
Place
Participant
Total Winnings
$ Behind Leader
1st
Chris
$24.00
2nd
Ken
$22.00
-$2.00
3rd
Paul
$20.00
-$4.00
4th
Josh
$18.00
5th
Kelly
$16.00
6th
Greg
$14.00
7th
Dave
$12.00
8th
Darren
$10.00
9th
Don
$8.00
10th
Tony
$6.00
11th
Suzanne
$4.00
12th
James
$2.00
13th
Spare 1
$0.00
14th
Spare 2
$0.00
15th
Spare 3
$0.00
16th
Spare 4
$0.00
17th
Spare 5
$0.00
18th
Spare 6
$0.00
19th
Spare 7
$0.00
20th
Spare 8
$0.00

Hi j&s,
Numbers uses a data base model that treats each row of a table as a single record. You can sort all or selected rows on the values in one or more column(s), but the whole row moves to maintain the integrity of each record.
If you want some columns to be excluded from a sort, you need to remove those columns (or their data) from the table. Jerry has offered a way to do that for the rankings, but that solution will not resolve the issue of the 'leader board' cells acting badly in a sort.
Here's an alternate. The first view is of the table(s) (with the participants in alphabetical order), just after the current totals had been entered.
At this point, the Leader board, which pulls names and totals from the first three body rows of the data table, shows the correct cells, but these don't include the correct information.
Note that column A does show the correct placing for each participant.
The second view shows the same table(s) after the data table has bee sorted. The sort may be descending on column C (Totals) or ascending on column A (Place).
Place is calculated from the Total values, using this formula:
A2: =RANK(C2,C,largest-is-high)
Fill down into the rest of the cells in column A. Any empty rows should be removed from the bottom of the table, or have zeros entered into their total column cells.
The Leader board table has two formulas:
A2: =OFFSET(Data :: $A$1,ROW()-1,1)
Fill down to A4.
This returns the name of the participant in the top body cell of column B of the data table.
B2 contains the word "Leader"
B3: =IF((OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2))>0,OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2),"Leader")
Fill down to B4
The root of this formula is OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2)
This returns the total value from the first and second body cells in the total column, and subtracts the second from the first.
The rest of the formula is an IF statement tohandle the occasions where there's a two or three-way tie for the lead. (image below) If the result is greater than zero, the subtraction is repeated and the result returned to the cell (B3); if the result is zero, the word :Leader: is returned to this cell.
Placing the calculation in a separate table and using OFFSET, with a base cell (Data::A1) that is in a row defined as a Header row makes this table and its formulas immune from sorting of the Data table.
Here's the tie, which arose when i added another 11 particpants to check sorting of the Place column:
Regards,
Barry
Message was edited by: Barry (added image and notes on Tie case)

Similar Messages

  • Reading lock and pk column values

    Hi!
    I was wondering whether it is possible to somehow read the value a
    persistent object has for its lock column (JDOLOCKX by default) and pk
    column (with datastore identity, JDOIDX by default).
    Especially reading the lock would be useful. My specific problem is this:
    in J2EE environment when a persistent object is serialized and given to the
    web (or any other ui-) layer to display, its identity is lost. There are
    nice examples for solving this problem in the documentation so this is not
    an issue. However, there is no easy way to determine whether someone else
    changed the same data while it was being watched (and modified) on the web
    page. So, in essence, this is an optimistic transaction. However, to use
    optimistic transactions one would have to use stateful session beans. And
    if I am correct, an optimistic transaction has to have a live persistence
    manager all the time, so this is not acceptable unless the
    persistencemanager releses its sql connection in between calls. I don't
    think it does, or does it? And anyhow, I'd prefer using stateless session
    beans.
    It would be quite easy to implement some sort of timestamp mechanism by
    inserting a persistent field for it and updating its value by using
    InstanceCallback interface. However, as the JDOLOCKX column already exists
    it would be nice not to reinvent the wheel.
    The pk value I would need in case the same db is used by many apps (not
    all in Java) and they need to communicate some information about a specific
    object stored in the db (in which case it would be easiest to give the pk
    value to identify an object). Again, I could use ApplicationIdentity or
    make some field where to store some unique value, but I'd prefer using the
    pk value since it is already there (and would not like to use Application
    Identity just because of this).
    Any other solutions to the above problems besides being able to read the
    JDOIDX and JDOLOCKX values are welcome, too.
    -Antti

    You can either parse the toString () generated from
    JDOHelper.getObjectId () or cast it to ObjectIds.Id (in 2.5.x) or Id (in
    3.0) to get the pk value.
    You can also retrieve the lock version in the same fashion.
    In Kodo 3:
    KodoHelper.getVersion (yourPC).
    In Kodo 2.5.x:
    ((PersistenceManagerImpl) pm).getState (JDOHelper.getObjectId
    (yourPC)).getVersion ();
    Antti Karanta wrote:
    On Tue, 14 Oct 2003 10:46:56 -0400, Patrick Linskey
    <[email protected]> wrote:
    Based on your description of your problem, you might want to look at the
    new attach/detach functionality in Kodo 3.0:
    http://solarmetric.com/Software/Documentation/3.0.0RC2/docs/ref_guide_detach.html
    This functionality is a preview of a proposed JDO 2.0 feature, and is
    targeted at exactly the use case that you've described.Yes, it definitely looks nice. One thing it does not mention, though:
    is the String stored in the detached-objectid-field just the (string
    version of the) primary key or is there something else there?
    And what about a case where I do not want a detachable instance, just
    want to be able to have the primary key value?
    And I take it there is no way to read these values (lock and pk) in the
    present version of Kodo?
    On Tue, 14 Oct 2003 18:38:21 +0300, Antti Karanta wrote:
    Hi!
    I was wondering whether it is possible to somehow read the value a
    persistent object has for its lock column (JDOLOCKX by default) and
    pk column (with datastore identity, JDOIDX by default).
    Especially reading the lock would be useful. My specific problem is
    this: in J2EE environment when a persistent object is serialized and
    given to the web (or any other ui-) layer to display, its identity is
    lost. There are nice examples for solving this problem in the
    documentation so this is not an issue. However, there is no easy way
    to determine whether someone else changed the same data while it was
    being watched (and modified) on the web page. So, in essence, this is
    an optimistic transaction. However, to use optimistic transactions
    one would have to use stateful session beans. And if I am correct, an
    optimistic transaction has to have a live persistence manager all the
    time, so this is not acceptable unless the persistencemanager releses
    its sql connection in between calls. I don't think it does, or does
    it? And anyhow, I'd prefer using stateless session beans.
    It would be quite easy to implement some sort of timestamp mechanism
    by inserting a persistent field for it and updating its value by
    using InstanceCallback interface. However, as the JDOLOCKX column
    already exists it would be nice not to reinvent the wheel.
    The pk value I would need in case the same db is used by many apps
    (not all in Java) and they need to communicate some information about
    a specific object stored in the db (in which case it would be easiest
    to give the pk value to identify an object). Again, I could use
    ApplicationIdentity or make some field where to store some unique
    value, but I'd prefer using the pk value since it is already there
    (and would not like to use Application Identity just because of this).
    Any other solutions to the above problems besides being able to read
    the JDOIDX and JDOLOCKX values are welcome, too.
    -Antti
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Query on Locked entry and sorting a table

    Hello Friends,
    I have a query on the below
    1. I am running a BDC for TCODE IK11. sO IN A loop i use call transaction statement for
    updating the records. When the first record is created for a measurement point
    by running the tcode then the second recordshows that the measurement point is locked.
    and it doesnt let another record getting updated.
    what should be done in this case.
    2. I am trying to simply sort a table with the three fields.
    point date time. When i sort the table  by only point and time in descending order its
    working fine but when i am trying to sort the table by point date time it is not sorting
    it in descending order.
    My requirement is that i want the latest date and time of the measurepoint created in the system.
    Pls Help.
    Thanks
    Rohit

    Hi,
    Thanks, SupportsSortCollection is the one I was missing.
    Although now I can click the headings, it is pretty useless because sorting behaves totally erratic. (This is true even if showing the entire table, not only a given range of it.)
    For example the following happen randomly:
    - Mostly a columns is not sorted properly. After clicking it e.g. 3-4 times, it is sorted properly, but only in one of the orders (e.g. descending).
    - The ascending or descending order of the rows varies from click to click. E.g. the ascending order of rows is not the same every time.
    - Sometimes clicking does nothing, no sorting is fired.
    - Etc...
    So basically my question is still the same as in my first post. :(
    Regards,
    Patrik

  • How to show the columns (and sequence and sort order) of an INDEX?

    Assume I have an INDEX for an existing TABLE.
    How can I find out the columns covered by this INDEX (and the sequence and sort order)?
    Which table contains this information?
    all_indexes does not.
    Peter

    user559463 wrote:
    Assume I have an INDEX for an existing TABLE.
    How can I find out the columns covered by this INDEX (and the sequence and sort order)?
    Which table contains this information?
    all_indexes does not.
    Peter--
    select table_name, index_name, column_name, column_position
    from user_ind_columns
    order by table_name, index_name, column_position;

  • Apply custom repeat formatting, column deletion, and sorts?

    I download a .csv sales report file weekly.  Is there a way to create and apply a pre-determined/custom formatting, deletion of columns, and "sorts?"
    The .csv data contains the same fields/headers on each week.  Then every week I go through and delete the columns that I don't need and sort the data on the same criteria.  Is there a way to save these steps and apply them with each new report I open?
    It would be the equivant in Photoshop, of "recording" "actions" and "playing" them on opened files.

    There is no way to rtecord actions but if you describe exactly what you need, I may try to write a script doing the trick.
    The most efficient scheme would be to send to my mailbox an exemple of the csv file (ten rows would be sufficient) and the Numbers document which you want to get starting from this source.
    Click my blue name to get my address.
    Yvan KOENIG (VALLAURIS, France) mercredi 24 août 2011 21:29:19
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

  • Allow users to click on a Column Heading and sort

    Hi All
    I created a master Detail table using the BC4J tags, My users are able to search and return results to the DataTableQueryComponent but the would like to click on the column and sort by it.
    How do I achieve that
    Thank you

    With JSF and the ADF Faces table it's easy and built-in, you can right click the table and in the properties on the third tab you can specify for each column if it is sortable.
    In JSP I think you'll have to call a method that will set the order by for the view object and rexecute the query.

  • IMac; 10.9.2: Mail: lost scroll bar in sort column and mail

    right side scroll bar is missing both in sort column and when viewing an individual email from main screen.....
    HELP

    mskathk wrote:
    Did this setting change with one of the updates?
    Yes.

  • Locking the first column in advanced data grid on horizontal scrolling

    Hi All,
    My requirement is to freeze or lock the first column in the advanceddatagrid from scrolling on horizontal scroll event.
    The column should always remain in the left hand side of the grid.
    I tried with lockedColumnCount property of the advanced grid. But it is not working.
    Could anyone help me please with code examples

    I am able to do the above by using the method which passes
    the sort information to data provider. But now the problem I am
    facing is I cannot use event.preventDefault(); along with that
    method. If I use event.preventDefault(); then it does not show the
    descending arrow on the column, nor does it sort on multiple
    columns.
    But if I do not use event.preventDefault(); then the problem
    I am getting is it remembers the previous sort order for a
    particular column. eg. If I sorted on col A (desc)+colB and now I
    sort on colC. Again if I click on col A, the data provider sorts on
    colA ascending shows it and then the grid refreshes sorting on col
    A but in descending order.
    Does somebody know how to get around this problem?

  • Sort columns in matrix report

    Hi all
    I create matrix report( in version 9i)
    I want sort columns of report
    when i use order by it sort rows but i want sort columns
    my query is like this:
    SELECT
    Code,
    name,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E') Activity,
    SUM(amnt) amount
    From Mytable
    Where ....
    group by
    Code,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E')
    my group base on code
    my columns base on Activity
    and cells are Amount
    my report result is:
    ........ B E D A C
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    I want this :
    ........ A B C D E
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    ....

    Hello,
    How about this?
    SELECT Code, name,
    DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
    From Mytable
    WHERE ....
    GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
    ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')

  • Looking to Search and Sort String Twice, though am having issues

    I am inputing from an access file a test library, the files in the access file are out of alphabetical order...thus I search and sort and bring these into LV in alphabetical order.  But I am running into the issue of trying to further search and sort the second column of info via the model number:
    example:
    Model ............. Model #
    Zetor               55
    Challenger        55
    Ford                55
    Zetor               66
    Challenger        66
    Ford                 66
    Zetor               45
    Challenger        45
    Ford                45
    Zetor               96
    Challenger        96
    Ford                 96
    Need to Return the Files as per below:
    Zetor               45
    Challenger        45
    Ford                45
    Zetor               55
    Challenger        55
    Ford                55
    Zetor               66
    Challenger        66
    Ford                 66
    Zetor               96
    Challenger        96
    Ford                 96
    Attachments:
    search & sort string.JPG ‏65 KB

    actually in my original post I had a brain-lapse on what the final sort needed to be....
    I was looking for this:
    Challenger        45
    Challenger        55
    Challenger        66
    Challenger        96 Ford                 45
    Ford                 55
    Ford                 66
    Ford                 96
    Zetor                45
    Zetor                55
    Zetor                66
    Zetor                96
     thanks for the quick response.

  • Group and sort in webi report

    I have a requirement to group and sort in a report. Group should be based on id, sort based on time. Time sort should be the priority. Meaning, first criteria to sort is time, but if the id is repeated, time should be sorted for that id.
    e.g, If I have ids A,B,C and values are such that A - 9:15 AM, B - 9:00 AM, A - 10:00 AM, C - 9:30 AM.
    Requirement is as below
    B - 9:00 AM
    A - 9:15 AM
    A - 10:00 AM
    C - 9:30 AM
    If I apply sort on time without group on id, I am getting data in the below manner which is not correct.
    B - 9:00 AM
    A - 9:15 AM
    C - 9:30 AM
    A - 10:00 AM
    If I apply group first, I am not able to apply sort. Since the requirement is to show the least time first.
    Please advice.

    use the variable
    =Min([Time]) In ([ID])
    to sort. Then hide the column by reducing the width and making the font and background color as white.

  • Sorting Column's Label in Pivot Table

    Hi Fellows !!
    This is my problem: I have two tables, dates and rates, providing me data for a report. Dates has a DateId (number), Year(number) and Month(varchar2(12)), and Rates has DateId(number) and RateAmount(number). I wrote a quite simple query to obtain report's data:
    SELECT DATES.YEAR, DATES.MONTH, RATES.RATEAMOUNT
    FROM DATES, RATES
    WHERE DATES.DATEID = RATES.DATEID.
    I must to show as a pivot each rate by month for each year. Years must be showed as row heading and sorted descending (this already works) and Months must be showed as column's labels. Something like this:
    ----------|January|February|......|December|
    2008 | 737.3 | 372.3 |......| 342.56 |
    2007 | 346.2 | 456.6 |......| 678.78 |
    The problem is Months always appear in Lexicographical order: April, August, December, ..., September. How can I to define the correct sort for Month ? Thanks in advance for your help.
    Edited by: [email protected] on Sep 21, 2009 4:03 PM

    Hi Vetsrini, thank you for your answer.
    I've included an additional DATES table's field in query, and it contains the number of month, according to your suggestion. Results for query show month's names in proper form, but when I set up the pivot table from template builder and get preview for results (pdf, html, etc), I still get month's names in Lexicographical order. All the examples and documentation tips (sorting tags and others) I've found seems to apply to normal tables, because none of that works in my pivot table. Any other ideas are welcome.

  • Unable to update, when executed table gets lock and Execution does not stop even for an hour.

    Following is my Query, which unables to update. When Executed, table gets lock and Execution does not stop even for an hour.
    update Employees 
          set Status = 'Close'
          where statusid IN (select statusid 
                                             from MyView 
                                              where DownloadedDate ='2014-07-27 00:00:00.000'
    here Employee contains 3,00,000 of records and Subquery return 1,50,000 Empid 
    i tried in various ways but not able to solve, statusid  column have no index on,  i tried using cursor but it does not work.
    plz let me know how to solve this Issue, Its very Important to get solve as all my further work depends on Updation
    , THANKS IN ADVANCE.

    See also your other thread with the same question:
    http://social.msdn.microsoft.com/Forums/en-US/80243625-fc3b-4ee1-bce1-4adcdbc16c14/unable-to-update-when-executed-table-gets-lock-execution-does-not-stop-execution-even-for-an-hour?forum=sqlserversamples
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • J_security_check, JAAS, password expiration, account locking and portals

    J2EE form-based authentication will redirect an unauthenticated user trying to connect to a secured resource to a login page and will 1) send the user to the originally requested page upon successful authentication OR 2) send the user to the error page in the event of authentication failure. There are a couple of problems that I have with this implementation - not with j_security_check specifically, but with the pattern generally.
    There are several events that a Portal must manage beyond simple authentication validation. Specifically
    - Notify a user after successful authentication that their account has been locked and they must contact someone to get it unlocked.
    - Notify a user after successful authentication that their password is about to expire and offer them a choice between changing their password immediately or proceeding to the requested resource.
    - Notify a user after successful authentication that their password has expired and require that they change it before proceeding to the requested resource.
    - Notify a user after successful authentication that they don't have rights to access to the requested resource even though they've been successfully authenticated and offer to redirect them to a page that they are authorized to access.
    I am currently investigating a scheme to solve these problems by using servlets for the login and error 'pages', having these servlets forward to different .JSP's based on roles, and writing some sort of JAAS module to add an access (authorization) role based on the password and account lock status.
    Has anyone else worked on this kind of problem? Are there any efforts to extend the J2EE specifications to handle these alternate flows in the j_security_check activity.
    I'm frustrated with each of the different container providers handling the JAAS Authorization differently. Further, since the j_security_check doesn't discuss how the server tracks the original request, each container provider has used a custom mechanism for keeping the original URI as j_security_check activity proceeds.
    One final gripe, since the J2EE specification does not specify how to deal with JAAS, and further define a mechanism to getting the Subject associated with the current ServletRequest, all providers have done this differently too. Perhaps this was avoided as a 'non-goal', but wouldn't it have been nice to state that 'should a provider decide to offer JAAS based security, the implementation must...'?

    I understand this problem... I dont know whether I have term this as a "Feature" or a "Drawback".
    I have handled this problem differently in my project.
    Scenario: When user does normal login
    1. User is displayed a home page. During this process, I create a session variable "Initialized".
    2. I check for this session variable in all the pages. If this session variable is missing then I redirect to the home page which in turn creates the "Initialize" variable in the session.
    Scenarion: Session time out happens in Page 3
    1. User will be taken to login page.
    2. Typically scenarion, when user is authenticated successfully, Page 3 is displayed.
    3. I check for the session variable "Initialize" in Page 3. This "Initialize" variable will not be available due to session expiry.
    4. I redirect my page to "Home Page" which inturn creates session variable "Initialize".
    5. This solution solved the problem of showing home page when user does the login

Maybe you are looking for

  • Multiple itunes libraries on same computer and removable hard drives

    I have multiple itunes libraries, one resides on my internal hard drive on my computer and the other on a removable hard drive that I pug into the ocmputer via a USB cable, can itunes recognize both libraries at once, and how do I get it to do that?

  • IPod Mini doesn't show in windows (vista) as well as iTunes

    When i connected my mini to laptop with latest iTune, it suggested to download later firmware and it went thru fine. after i restart my laptop, neither laptop nor iTuens detect my iPod. Device manager shows "This device cannot start. (Code 10)". Trie

  • Executable JAR using JDeveloper

    Hi, I created a very small Desktop Application using JDeveloper. What I want to do is to create an executable JAR file. I mean, is there any option in this tool like the one in Eclipse. Once executable JAR is created, I must be able to run it just by

  • ERROR IN CREATING  REMITTANCE CHALLANS

    I am facing while creting internal  challans "Number key not found" Mesage no: 81705 . Pls usggest the solution. Best Regards, Sudhanshu Dang

  • Can not acceess photo shop elements 5 editor

    About 5 days ago I sent a help rquest to see if anyone could help me fix the reason why I can not access the editor on my PSE 5, at the same time I sent a request to Adobe for some help. I got the answer today stating that they don't support the Elem