Display all columns but only unique values in one column

My table looks like this;
ApprovalKey (PK)
ApprovalCCN (Links to main table)
ApprovalName
ApprovalDate
ApprovalMsg
ApprovalResult
Typical data would look like;
Key CCN ApprovalName ApprovalDate ApprovalMsg ApprovalResult
1 1 John Smith 12/12/2014 16:20:22 Testing the message False
2 1 Andy Brown 12/12/2014 16:20:27 testing the decline False
3 1 John Smith 12/12/2014 16:20:46 More testing True
4 1 Andy Brown 12/12/2014 16:25:13 testing True
5 2 Andy Brown 12/12/2014 16:25:26 testing the accept True
6 2 John Smith 12/12/2014 16:34:04 testing, 1 2 True
When I view data from linked table (matched via ApprovalCCN) It should display data from this table but only the latest unique entry from ApprovalName.
eg, table from above has 4 entries for ApprovalCCN=1 but should only show the following;
Key CCN ApprovalName ApprovalDate ApprovalMsg ApprovalResult
3 1 John Smith 12/12/2014 16:20:46 More testing True
4 1 Andy Brown 12/12/2014 16:25:13 testing True
Distinct ApprovalName doesn't return all values and I can't seem to get my head around Group By to view all columns
Any help would be appreciated

Here is my test data;
7 30 John Smith 12/12/2014 16:20:22 Testing the message False
8 30 Andy Brown 12/12/2014 16:20:27 testing the decline False
9 30 John Smith 12/12/2014 16:20:46 More testing True
10 30 Andy Brown 12/12/2014 16:25:13 testing True
20 30 David Jones 12/12/2014 16:25:26 testing False
21 30 David Jones 12/12/2014 16:34:04 Testing the message True
25 30 Me 12/12/2014 16:35:05 testing the decline False
26 28 You 12/12/2014 16:36:05 testing the decline False
27 28 Me 12/12/2014 16:37:05 testing True
28 28 John Smith 12/12/2014 16:38:05 testing the decline False
29 28 David Jones 12/12/2014 16:39:05 testing the decline False
30 30 David Jones 14/12/2014 17:39:44 True
31 29 David Sawyer 14/12/2014 18:51:06 declining the offer False
32 29 David Sawyer 14/12/2014 18:51:37 My message False
33 29 David Sawyer 14/12/2014 18:52:01 another message False
34 29 David Sawyer 14/12/2014 18:52:16 True
35 29 David Sawyer 14/12/2014 18:52:25 True
36 29 David Sawyer 14/12/2014 18:52:34 True
If ApprovalCCN=30 I get the following;
10 30 Andy Brown 2014-12-12 16:25:13.000 testing 1 1
30 30 David Jones 2014-12-14 17:39:44.000 1 2
9 30 John Smith 2014-12-12 16:20:46.000 More testing 1 1
25 30 Me 2014-12-12 16:35:05.000 testing the decline 0 1
All I need is 3 Approved, 1 Declined
Apologies if I wasn't clear

Similar Messages

  • This column cannot enforce unique values because this list or document library may contain items that are not viewable by all users.

    The above error occurs when I place unique constraint on a column in a custom list. This error only occurs because the custom list has been configured to only allow creaters to view and edit their own list items.
    I just can't see why that should prevent SP from placing a unique value constraint though.
    One easy workaround would be to place the unique constraint on the SQL Server table that represents this list. However, in a hosted environment, it is not always possible to gain access to the backend server. What is more, I am uncomfortable with this
    approach as it may break other parts of SP 2010.
    Is there any other approach?

    Hi,
    If SharePoint were to enforce uniqueness on a column in a list where users are only allowed to see and edit list items that have created, then you could have a scenario where -
    a. user1 tries to add a new item to the list which violates the uniqueness constraint
    b. SharePoint reports an error
    c. user1 gets to know that there is another item containing the same value in this list
    d. this violates the security settings that you configured (each user should be allowed to only see the items that they have created). Now if you change the permissions settings to allow users to SEE all items, but only
    edit items that they have created, this error disappears (obviously).
    Now getting to the workaround you mentioned (creating a unique constraint on the SQL Server table). This is not going to be possible for numerous reasons -
    a. Modifying (or for that matter, even performing SELECT operations on) the SQL Server tables is an unsupported operation and it will definetely break other things in SharePoint, not
    to mention that you will lose all support options from Microsoft. However if you don't care about this, then it will still not be technically possible because...
    1. SharePoint does not create a new SQL Server table for every list/library. 
    2. If you did get around to enforcing a unique constraint in the one single table that SharePoint uses for all lists, then you will be enforcing this constraint on each and every list in all the sites and in all the site
    collections that are assigned to that content database.
    Please "Mark as Answer" if a post has answered your question or "Vote as Helpful" if it was helpful in some way. Here's
    why

  • I Cant insert all values to the table But only Default Values r inserted?

    Hai,
    i can insert only default values to the database. Other values are not shown in DB.
    Steps I have done so far:
    I have created EO based on VO and VO has the query : select * from emp. Attached to AM.
    That AM is attached to the Page. The page consists of employeed details and SAVE button.
    Set controller for that page and CO-PR calls create method in AM .
    Default values for who columns and SLNo also set through sequence.
    In CO-PFR I call apply method which commits the data.
    when i run the page and giving values it is not inserted into table but only default values are inserted.
    I checked with System.out.println(getattribute("my attr").toString()). It send output correctly.
    But y other values are not inserted.?
    Anybody plz plz help me in this regard. I am struggling with this for last 1 week. I have to apply this to another realtime scenorio? Deadline is near.
    Regards,
    Lakshmi Chandiran

    Hai Prince,
    Thanks for your immediate response. pls find my codes written in EO,AM,CO.
    In VO i havent added anythig xcept the query.
    The following fields are only getting inserted in the table.
    My EOImpl code:
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    System.out.println("NOW I AM IN CREATE METHOD");
    OADBTransaction transaction = getOADBTransaction();
    Number EMP_ID = transaction.getSequenceValue("Employeeid");
    setEmpId(EMP_ID);
    setCreationDate(transaction.getCurrentDBDate());
    setStartDate(transaction.getCurrentDBDate());
    setLastUpdateDate(transaction.getCurrentDBDate());
    setCreationDate(transaction.getCurrentDBDate());
    VO:
    select * from emp1
    AM:
    public void saveForm()
    OAViewObjectImpl empvo = getEMP_VO();
    System.out.println("NOW I AM IN AM SAVEFORM OF EMTS");
    if ( !empvo.isPreparedForExecution())
    empvo .executeQuery();
    Row prow = empvo .createRow();
    empvo .insertRow(prow);
    prow.setNewRowState(Row.STATUS_INITIALIZED) ;
    System.out.println("NOW I AM IN ROW CREATED");
    public void commitdata()
    System.out.println("commitMethod()") ;
    getDBTransaction().commit();
    CO:PR & PFR:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if(!pageContext.isFormSubmission())
    pageContext.getApplicationModule(webBean).invokeMethod("saveForm",null);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule EMP_AM = pageContext.getApplicationModule(webBean);
    OAViewObject vo = (OAViewObject)EMP_AM.findViewObject("EMP_VO");
    if ( pageContext.getParameter("BtnSave") != null )
    pageContext.getApplicationModule(webBean).invokeMethod("commitdata");
    s1 = (String)vo.first().getAttribute("Empname");
    s12 = (String)vo.first().getAttribute("Emptype");
    s3 = (String)vo.first().getAttribute("Emporg");
    s4 = (String)vo.first().getAttribute("Empcity");
    System.out.println(" values are " + s1+s2+s3+s4);
    here i can get the values correctly printed in output as entered in the form.
    I dont know where the problem is.
    plz help me.
    Thanks in advance,
    Regards,
    Lakshmi Chandiran

  • How to add only highest values in the column

    Hello All,
    We have report where I need to add only highest values in 'Price' column.
    Ex:
    Group  Mat      Price
    Grp1    Mat1    50
               Mat2    75
               Mat3    100
    Grp2    Mat1    50
               Mat2    100
    I need my result as 200...
    Any input is appreciated!
    Thanks in advance !!
    Venu.

    Sriman/Surendra,
    Unfortunately, this approach does not work because the Calculate Result As --> Maximum applies not only to the subtotals but also to the grand total. Therefore, the result in Venu's example will be:
    MAX(Grp1) = 100
    MAX(Grp2) = 100
    MAX(All Grps) = 100
    We have the same requirement as Venu, but have not found a satisfactory solution yet. The only way we have solved such problems in the past is to use VBA in workbooks, but the report we are using now is a Web report.
    Hope this helps to clarify the issue...
    Bob

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • TV Out Issue- No display of screen but only the audio sound can be heard

    I have alway being using my iPhone 4 to watch my video/ mirroring by connected to TV (Sony) through 30-pin digital AV adapter, but after the upgrade of software to version 6.1.3 (10B329). During TV out, showing no display at screen but only the audio sound can be heard at background. Appreciated if there could be a update to fix this issue.
    Thank you
    Regards,
    Devil38

    Thanks you. Problem is solved. The cable wasn't plugged in properly.
    In spite of video rendering smoothly, audio started coming only when I disconnected the cable and plugged it in hard.
    Perhaps I was pampering my phone too much
    -3310
    -N80
    -N8

  • How do you make a Spry menu view on all pages but only have to change it one place?

    How do you make a Spry menu view on all pages but only have to change it one place? Someone told me maybe I could create a Library item. Any help will be appreciated.

    If your pages all have the same basic design, using a DW Template would be a way to do it...
    http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7abea.h tml

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to pass column name as a   values from one page  to another

    hi
    i have created a report(pivot) from a table
    SQL> SELECT * FROM T;
    C1  C2          C3 D                SEQ
    A   AA           2                    1
    A   AB           3                    2
    A   AC           2                    3
    B   AB           5                    4
    B   AC           6                    5
    SQL> SELECT C1
      2  ,NVL(MAX(CASE WHEN C2='AA' THEN C3 END),'') AA
      3  ,NVL(MAX(CASE WHEN C2='AB' THEN C3 END),'') AB
      4  ,NVL(MAX(CASE WHEN C2='AC' THEN C3 END),'') AC
      5  ,SUM(C3) FROM T GROUP BY C1;
    C1          AA         AB         AC    SUM(C3)
    A            2          3          2          7
    B                       5          6         11
    SQL>
    my requirement in Apex is like this(reverse)
    eg-
    when i click on cell values '2' then,it should return
    C1  C2          C3 D                SEQ
    A   AA           2                    1
    {quote}how to pass column name as a  values from one page to another
    for example i have to pass 'c2' as a value to next page{quote}for report pivot you can reffer below link
    Report
    Amu

    thanks for your reply
    i 'm doing what exactly you mention here .
    my problem here is
    i have 15 columns
    i am executing a query based on the values of the column(column name)  in the target page
    1)here i am passing(all) the column values to the next page-but  i want to pass only one column values(column name)
    when i click on any cell of that  column
    OR
    2)i can pass all column name to target page -there(in the target page) i can filter out
    i think option 1 would good if you filter out the unwanted columns
    Regards
    Amul

  • Making whole row coloured red based on value in one column in BI Answers.

    Hi
    Would anyone know how to make a whole row red (eg) based on the value from one column within the row in
    a BI Answers report in either a pivot table or a table view. I know it should be a case of setting up the
    conditional formatting in the Conditional Tab on the Properties of the column, but all the columns apart from the
    one with the value being determined ignore the value in another column.
    Thanks,
    - Pete
    Edited by: user1636556 on 09-Dec-2011 07:58

    Hi
    Would anyone know how to make a whole row red (eg) based on the value from one column within the row in
    a BI Answers report in either a pivot table or a table view. I know it should be a case of setting up the
    conditional formatting in the Conditional Tab on the Properties of the column, but all the columns apart from the
    one with the value being determined ignore the value in another column.
    Thanks,
    - Pete
    Edited by: user1636556 on 09-Dec-2011 07:58

  • How to retrieve value of one column to other in Apex using Javascript

    Hi all,
    Can any one help me in solving this problem.
    How to send a value from one column to another column using javascript in Apex. I heard that we can use onChange().
    My requirement is,
    I have a column(Varchar2) in form where i need to enter a value and the data need to be sent to another column(Number) when i press apply changes.
    ex: if i enter a value say 1/3 or 1/4 or 1/3*1/6
    the result should be entered in the other column.
    Message was edited by:
    Raman

    Try something like
    html_GetElement('P1_ITEM2').value = eval(html_GetElement('P1_ITEM1').value);

  • Multiple value in one column issue

    Dear proffessionals,
    i'm trying to put more than one value in one column, so i have next problem:
    1. Query select cr_pjid from acc_users where username='ACCBTPS121' give result
    CR_PJID 
    '26','63'2. Query select * from acc_accbtp_nova_view where ed_id=2 and to_char(pj_id) in ('26','63'); return 186 rows.
    3. Query: select * from acc_accbtp_nova_view where ed_id=2 and
                  to_char(pj_id) in (select cr_pjid
                  from acc_users
                  where username='ACCBTPS121'); doesn't return any row... :(
    Could anyone help me ?
    Thx in advance,
    Adnan

    After researching, I think that the best idea is to create another table with multiple rows and different values for one column...
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • Concatenate out put of 2 or more columns in BEX Report in to one column

    Hi,
    I am working on service order report in BEX, and i would like to Concatenate out put of 2 or more columns in BEX Report in to one column.
    Please share me if any scenarios.
    Thank
    Neni

    Hi Ashutosh,
    Thanks for your reply,
    Actually in my report 4 different columns belongs to service orders information from different departments, i want see all 4 columns information in to single column, those four are virtual characteristics.
    As per your solution concatenate in workbook using function, can you please give me the steps how to do that.
    Thanks for your help.
    Thanks
    Neni.

  • Display rows which has only unique column values

    One of my table has the following data in it.
    ORDER_NO    IND_CODE
    1002              DNA
    1004              GEN
    1005    
    1007              DNA
    1008              DNA
    1009              GEN
    1010    
    1000              NULL
    1001              NULL
    1003              NULL
    1006              NULL
    1000              ZZZ
    1005              ZZZ
    I just want to display the rows with unique ORDER_NO.
    Sarvan

    You have 1000 as duplicate values in the column. But both have different indcode.
    Select distinct order_no from [table name]
    If you need combination of order_no and ind_code as unique then .
    Select distinct order_no, ind_code from [table name]

  • Expense reporting, get values from column and return only unique values somewhere else

    i would like check a column for the values it contains (expense categorizations) and then return a list of only the unique values somewhere else in a vertical list. So "gasoline" may be listed 12 times in the reference list but in my result listing i would expect it to only show up once. If there is a way to do this then I would also like to know how empty cells are handled.
    I will then be applying a SUMIF to the returned list to get totals for all the unique categorization a have specified.
    Thank you for your time.

    Deleting the first row made your $F$2 become $F$1.
    Explaining how a formula works is not so easy to do. I'll try, but the best way is to read up on the formulas and piece it all together.  There's nothing fancy or tricky going on here.
    The "active ingredient" in the formula is this piece: OFFSET('Table 1-2'::$F$1,SMALL('Table 1-2'::G,ROW()−1)−1,0)
    ROW() returns the row number of the cell that has the formula in it. It is an easy way to get an ever increasing number for the formula. The other way would be to have another column with 1,2,3,4, etc. in it.  So, ROW() will return the number 1 if the formula is in row 1, will return the number 2 in row 2, etc.
    SMALL(range, n) returns the nth smallest number from the given range of numbers.  So, for the formula  in row 2, SMALL('Table 1-2'::G, ROW()−1) becomes SMALL('Table 1-2'::G, 1) which will return the 1st smallest number from the G column of Table 1-2.  In the 3rd row it would return the 2nd smallest number. Etc.  And remember that those numbers it is returning are the row numbers of your unique values in Table 1-2.
    OFFSET(base, row offset, column offset) is a way of  referencing a cell.  For instance, OFFSET($F$1,1,0) would be one row down from cell F1. OFFSET($F$1,2,3) would be two rows down and three columns to the right of cell F1.  The SMALL formula has given you the row number for a unique value in your Table 1-2.  To reference the correct row, the row offset from F1 needs to be one less than that number (an offset of 0 = cell F1. An offset of 1 = cell F2, etc.). The column offset is zero.

Maybe you are looking for

  • Purpose of account determination in Sales Order

    Hi My question is whether account determination happens at Sales Order level and if yes what is the purpose. Since I saw account determination procedure only to be assigned at billing document type but not in sales document type.

  • Can't delete files backed up in Time Machine

    I use Time Machine to back up my MacBook Pro to NAS on my home wifi. I have a large file in my downloads folder that I have moved elsewhere and I don't need backed up. When I enter Time Machine's 'Star Wars' window and select the file and choose to d

  • Open Hub - Header in flat file

    Hi there Experts. I am working with a opeb Hub destination, and so far everything has been straight forward. But i need to include headers in the first line of the file. By default the Open Hub i generating a Control File, so it is possible to look i

  • 2.0.1 Issues

    I am on firmware 2.0.1 and am having some problems with it. I have had to restore numerous times because it gets stuck on the Apple Logo, on bootup. For some reason this always happens. No matter what I do. Please help

  • Where are the Keyboard Shortcuts for Acrobat X?

    In Acrobat 9 I could delete a page by keying Alt - D - X. I could insert pages by keying Alt - D- N - F. Can I not do this kind of thing in Acrobat X? George Sullivan