Help with One to Many Formula

Post Author: Don
CA Forum: Formula
Hello Everyone,
I need some assistance.  I have a one to many relationship...
Example...
TABLE 1
FieldName = RecordID
DATA, RecordID= 10
TABLE 2, linked one to many to RecordID in TABLE1
FieldNames = RecordID, Name, ContactType
DATA, RecordID= 10, Name= Tom, ContactType= Sales
DATA, RecordID= 10, Name= Dan, ContactType= Service
DATA, RecordID=10, Name= Jon, ContactType= Sales
What I am looking for is to create a formula that would return something that looks like this....
Sales Contact Name
Tom, Jon
So... I want to grab all the "Contact Types" of "Sales" from TABLE 2 then pass in the "Name" field from TABLE 2 and if there is more then one "Name" of the sames "Contact Type" then comma seperate it.
And...  I don't want to do this in a sub report.   I do know I can make a sub report and return both values but to my knowledge the values would be on top of one another and not beside each other comma separated.
Ideas?

Post Author: Don
CA Forum: Formula
That may work using a subreport...
I think the root of this my problem is the fact I have a table relationship, left outer... one to many join.  So even if I drop your suggested formula in my report I still get repeating record details with blank names where all the other contact types would be.
Ticket Number       Contact Name     Contact Type
111111                  Dan, Jim               Sales
111111                                                                 <---- where the other contact type appear
111111                                                                 <---- where the other contact type appear
I was trying to avoid having to create several subreports for each data field I need on the report.  However, I think I can use your formula in a subreport to allow the data to display in a comma separated row rather then a vertical list.
I thought about suppressing but that won't work because I have other contact types I need to list.
Thank you for responding.

Similar Messages

  • Help with 'Send to Many" on 5210 please

    I am getting closer to the answer I need about sending a text message to as many people as possible from as inexpensive a phone as possible. Thanks to Jalisinfo for your help with my previous post. I have pasted below the response I have been sent from the Nokia care team to my question. Can anyone help with the part they were unable to answer about how many recipients I would be able to send to using this phone? I need to be able to send to about 70 contacts. All the recipients would be the only people in the contacts list.
    "Pertaining to our previous email, the Nokia 5210 does not support the SMS distribution list feature. On this device, you can send SMS to more than one contacts. This feature is known as "Send to many".
    We are unable to advise on the number of contacts you can send the SMS at one time."
    Thanks to you all for your help.

    oops

  • Need help mapping one-to-many relationship

    [Sorry, inadvertently cross-posted]
    Hello,
    I have a one-to-many mapping question that's probably a no-brainer for the
    experts of the group out there. My problem is that I can't get a collection
    of Items for a given Theme to be populated and I don't know if it's a
    problem in my system.jdo or in my classes (or both). For example, for Theme
    10,
    I want a collection of two Items, item_ids 1 and 2.
    I have db tables named ITEM and THEME with the following layouts:
    ITEM
    |==========================================================|
    | item_id(pk) | item_name | item_number | theme_id(fk) |
    |==========================================================|
    | 1 | This is Item1 | 1234 | 10 |
    | 2 | This is Item2 | 2954 | 10 |
    | 3 | This is Item3 | 2094 | 17 |
    | 4 | This is Item4 | 946 | 11 |
    | ... |
    |==========================================================|
    THEME
    |=======================================|
    | theme_id(pk) | theme_description |
    |=======================================|
    | 4 | Space |
    | 10 | Town |
    | 11 | Train |
    | 17 | Pirate |
    | ... |
    |=======================================|
    I have two PersistenceCapable classes that map to the above tables:
    package com.lego.data;
    public class Item
    public int item_id;
    private String item_number;
    private String item_name;
    private int theme_id;
    public Theme theme;
    public String toString()
    return
    item_number+":"+item_name+":"+theme.getCode()+":"+theme.getDescription();
    package com.lego.data;
    import java.util.*;
    public class Theme
    public int theme_id;
    public String theme_description;
    public Collection items;
    public String toString()
    return theme_id+":"+theme_description;
    and here is my system.jdo file:
    <?xml version = "1.0" encoding = "US-ASCII"?>
    <jdo>
    <package name="com.lego.data">
    <class name="Item" identity-type="application"
    objectid-class="com.lego.data.IntOId">
    <extension vendor-name="kodo" key="table" value="item"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="item_id" primary-key="true">
    <extension vendor-name="kodo" key="data-column" value="item_id"/>
    </field>
    <field name="item_number">
    <extension vendor-name="kodo" key="data-column" value="item_number"/>
    </field>
    <field name="item_name">
    <extension vendor-name="kodo" key="data-column" value="item_name"/>
    </field>
    <field name="theme_id">
    <extension vendor-name="kodo" key="data-column" value="theme_id"/>
    </field>
    <field name="theme">
    <extension vendor-name="kodo" key="theme_id-data-column"
    value="theme_id"/>
    </field>
    </class>
    <class name="Theme" identity-type="application"
    objectid-class="com.lego.data.ThemeKey">
    <extension vendor-name="kodo" key="table" value="theme"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="theme_id" primary-key="true">
    <extension vendor-name="kodo" key="data-column" value="theme_id"/>
    </field>
    <field name="theme_description">
    <extension vendor-name="kodo" key="data-column"
    value="theme_description"/>
    </field>
    <field name="items">
    <collection element-type="Item"/>
    <extension vendor-name="kodo" key="inverse" value="theme"/>
    </field>
    </class>
    </package>
    </jdo>
    Thanks in advance for the help.
    -Tim

    Abe White wrote:
    The first thing to check is that you are always setting the "theme" field in
    your Items. If you add an Item i to the "themes" collection of a Theme t, but
    forget to also set i's "theme" field to t, then the change will never get
    written to the database.
    Next, make sure that whenever you set the "theme" field of an Item, you also
    set
    its "theme_id" field. You map both of these fields to the same column, so you
    better be sure they stay in synch.
    On a related note, you might try making the "theme_id" field non-persistent if
    things still aren't working for you. Mapping two fields to the same column
    might be causing trouble. It would be safer to make theme_id non-persistent
    anyway, and to always grab the id from the Theme stored in your "theme"
    field.
    Better OO programming and all that, though I can see that you might have
    performance issues in mind when doing it your way.
    Anyway, if you find that it works when you make theme_id nonpersistent, let us
    know and we'll see why the double-mapping of the column is causing problems,
    and hopefully find a fix.Abe,
    Thanks for the response but I'm still confused. I failed to mention that
    the Item and Theme tables are in an existing schema, so as you saw in my
    system.jdo, I am specifying application identity.
    Since this is an existing schema, the Item table has theme_id as the
    foreign key to the Theme table. So are saying that it is a problem to map
    the both theme_id as a data column and a Theme object in the Item at the
    same time?
    I guess what I don't understand is exactly what my system.jdo should look
    like to map a one-to-many relationship. In my case, from Theme (1) to Item
    (many). (See my system.jdo in previous post).
    Thanks
    -Tim

  • Need Help with One to One Mapping in SQL

    Can aynone please design me tables in Oracle .
    I want to have a two tables with one to one mapping .
    Following is the scenario.
    I have an Employee object and a Parking Space Object. The have a one to one relation i.e., an employee will always be associated to only one parking space, that parking space should not be associated to any other employee.
    It would be a great help .

    sb92075 wrote:
    We don't do homework assignments.I used to do my own... seems like a novel concept now-a-days :)

  • 2 minor issues need help with one BBM and one email

    I am hoping someone can help with this
    the BBM issue is one of my contacts that has the z10 doesn't show option for my to video chat with him all my other contacts do and he has it displayed on his side and all his options are set same as mine
    second question is since i set up my activesync email it has pushed a password on my phone everytime it goes to sleep and i go to options and cannot turn off the device password option.
    Hope someone has some ideas

    It sounds like the account you connected to for ActiveSync has an IT policy that requires the password. You can't get around it. You'd have to talk to them.
    For BBM, have you verified the PIN is correct on each end? Can you BBM directly with this person? You both have to be on wifi, as well.
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • SSAS 2008 snowflake - dimensions with one-to-many relationship (NOT fact table) and hierarchy?

    Hi, below is my data model for SSAS 2008 on snowflake schema.
    Below is SQL Server DW tables:
    DimStudent - StudentID [primarykey], StudentName, DateOfBirth, AddressID
    DimStudentAddresses - AddressID [primarykey], StudentID [foreignkey], ddressLine1, AddressLine2, AddressType
    FactEnrolment - StudentID, EnrolWeek, EnrolFees
    So here FactEnrolement.StudentID is joined to DimStudent.StudentID column,
    and relationship between DimStudent & DimeStudentAddresses is one to many I.e. one student can have multiple addresses like primary or secondry address.
    To design snowflake schema in SSAS 2008 BIDS project :
     [Question-1] how to join one-to-many dimensions (NOT fact table) Like DimStudent & DimAddresses?
     [Question-2] At the end I want to have a single dimension only I.e. Student which should have both DimStudent & DimStudentAddresses tables attributes init. So I can create hierarchy from these two table into a single dimension? How
    to do this?
    Please reply with feedback particular to my above scenario as I refereed other MSDN forums but nothing solid I found.
    Any STEP-BY-STEP guideline please. Many thanks.

    Hello KM,
    Have you solved this issue after refer to Bill's suggestion? Please let us know how things go.
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Elvis Long
    TechNet Community Support

  • Move VS Windows App (Access DBS with one to many form)

    I have a VS Windows App (forms connected to an Access DBS-including one to many form) and would like to have users access via our SharePoint 2001 site...
    thank you.
    mjschukas

    Hi mjschukas,
    This forum is to discuss problems of Windows Forms. Your question is related to SharePoint.
    You can consider posting it in sharePoint forum(http://social.technet.microsoft.com/Forums/en-US/home?forum=sharepointdevelopmentprevious)
    for supports. Thanks.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Controlling Delete Order with One-To-Many

    I have a class that has six 1-M mappings. All of them have a 1-1 back reference. I would like to control the order of deletion to ensure that one of the child collections is always deleted last.
    It was suggested to me to use an after-load method to call addConstraintDependencies on the parent descriptor to control the order. This method is being called (before login) but it did not change the order. I added the after-load to the parent descriptor, adding the constraint dependency of the class I want deleted last.
    I also tried using "multi-table info" (in addition to the regular one-to-many mappings) but that seems to cause the valueHolder to retrieve the items from the table twice, giving me a list with "doubles" of every item.
    What can I do to control the order of the deletes of the children?
    Thanks,
    Allen

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819&#55728;&#57235;" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • TopLink11 Tutorial problems with one-to-many relation

    Hi,
    I installed TopLink 11 and the related tutorial to work in a simple Eclipse project.
    Everthing works fine except for the storing of the one-to-many relation in the database.
    The tutorial works with employee, address and phone tables/classes. Plain Objects can be stored and one-to-one relations too. However when trying to store a one-to-many relation not the key of the related object (which is at that tome well known) but the object is tried to be entered
    in the Logfile I find:
    [TopLink Fine]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, ADDR_ID, VERSION) VALUES (?, ?, ?, ?, ?)
         bind => [1501, Pascal, Blaise, 2252, 1]
    [TopLink Finer]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Register the object Employee: Blaise Pascal
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query DoesExistQuery()
    [TopLink Finer]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2008.01.10 10:28:58.370--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query UpdateObjectQuery(Employee: Blaise Pascal)
    [TopLink Finest]: 2008.01.10 10:28:58.386--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(PhoneNumber[desk]: (603) 123-4567)
    [TopLink Fine]: 2008.01.10 10:28:58.386--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO PHONE (P_NUMBER, EMP_ID, AREA_CODE, TYPE) VALUES (?, ?, ?, ?)
         bind => [1234567, {Employee: Blaise Pascal}, 603, desk]
    [TopLink Warning]: 2008.01.10 10:28:58.511--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071214)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Ungültiger Spaltentyp Error Code: 17004
    the highlighted section should be 1501 (the key of the employee record)
    Any ideas how to fix this?
    Thanks Erika

    Erika,
    You need to specify the other side of the relationship (on the PhoneNumber side), which is done by putting a @ManyToOne annotation on the "employee" attribute in PhoneNumber. That will cause TopLink to know that it is a relationship and not a basic mapping.
    -Mike

  • Select with One-to-Many and Many-to-One without repeating

    Hi
    I have a customer who needs a report two sides left and right, but allowing for One-to-Many and Many-to-One relationships in the one report.
    A little background:-
    This has do do with listings on land and buildings.
    One building can be built on a few pieces of land.
    Similarly, there can be several buildings on one piece of land.
    What is required is a listing of buildings on the left, land on the right, but without repeating the "single line entries" either left or right.
    For example Building1 is on Land1 and Land2, and Building2 and Building3 are built on Land3.
    We need:-
    Building1 Land1
    ________Land2
    Building2 Land3
    Building3______
    The ___ just used for spacing so you get the idea ;)
    Essentially - a "break by" on columns on the left and right.
    The Buildings and Land are in different tables, with a link table - one row for each link.
    Any ideas?
    Thanks
    Mike

    To jitu.jk - first, this is not in SQL*Plus - its a report in APEX - second, I see no way to break on the left and the right in the same select.
    Maybe there is a way.
    To Etbin
    This is a very inovative solution - I've tried it out and the result is:-
    BUILDING LAND
    _____Land 4
    _____Land 3
    _____Land 5
    Building 2 Land 4
    Building 3 Land 1
    _____Land 4
    Building 4 Land 4
    Building 5 Land 3
    _____Land 4
    (The underscores I put in for spacing - not perfect but you get the idea - hard whe you write the reply in a fixed space font and it's displayed in the forum in variable space font!! ;)
    9 rows selected.
    This is not quite the desired result - in your list of associations, we have Building1 associated with Land 3,4, and 5.
    So for Building 1 we should have:-
    Building 1 Land 3
    ________Land 4
    ________Land 5..........
    But your result doesn't include Building 1 at all.
    The other requirement is that no building or land is ever repeated - so I came up with the concept of "groups".
    Starting with one building - I find all pieces of land that are associated - listing them on the right (without repeating the building.
    I then find any other buildings asociated with any of the land records that the first building was associated with.
    These are listed on the left - without repeating the land records on the right.
    This group is given a unique identifier of the minimum association ID (my associations have ID's).
    This all done, I use the unique ID as a break column ans summarise additional columns (area, value etc) below each group.
    Because of the summaries - adding area and value etc, I can't have any building or land duplicated as I would then "double count" the area, value etc.
    Maybe you method can be made to work with some tweaking.
    Very clever indeed - forums need great answers like this - it keeps us going.
    Thanks again
    Mike

  • Insert with one-to-many mapping

    Hi,
    I've got the following situation:
    - an object A with a vector of object B
    - I defined a one-to-many relation in the descriptor of A referencing a collection of B using indirection through valueHolderInterface, the "private owned" is also checked
    - I defined a one-to-one relation in the descriptor of B referencing the object A using indirection through valueHolderInterface
    - the bidirectional relationship is maintained.
    I try to insert a new object A with a new object B inside. The code is as follows:
    A = new A();
    B = new B();
    // ... set the A attribute values
    // ... set the B attribute values
    A.addB(B);
    UnitOfWork uow = session.acquireUnitOfWork();
    uow.registerNewObject(A);
    uow.commit();
    where addB(b) is as follows:
    ((java.util.Vector)bvector.getValue()).add(b);
    b.setA(this);
    Executing this code, the object A is inserted in the database but the object B is not. And I would like that the object B is also stored in the database. Do I really have to register it? I want to make the insert in just one transaction. Have anyone an idea? I tried a lot of different configurations and just one SQL insert order is generated by Toplink.
    Thanks,
    Frédéric

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819&#55728;&#57235;" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • Hello, I would like to download my contacts from icloud to a flash drive in order to print out.  Can anyone help with this?  Many thanks

    Hello, I would like to download my contacts from icloud to a flash drive in order to have them printed out as I have over 4,000 contacts.  Could anyone help with this?  Thank you

    This  this discussion >  https://discussions.apple.com/message/24150181#24150181

  • Confused with one to many relationship

    Hi Masters ,
    Reading about one to many : i came across this
    Each row in Table A can have many (zero or more)
    matching rows in Table B but each row in Table B
    has only one matching row in Table A.
    A ZipCode can have many Students but each Student has only
    one ZipCode
    Theoritically this would be fine but can anyone please make tables for the above so i want to see it pratical work.

    zip
    (zipcode varchar2(6)
    , low_street_number varchar2(10)
    , high_street_number varchar2(10)
    , odd_even char(1)
    , city varchar2(30)
    , constraint zip_pk primary key (zipcode)
    student
    (studentno number(10)
    , firstname varchar2(30)
    , lastname varchar2(30)
    , zipcode varchar2(6)
    , constraint zip_fk foreign key(zipcode) references zip_pk
    Sybrand Bakker
    Senior Oracle DBA

  • Help With JScrollPane and many JLabels...

    I am in the process of designing an 'image browser' applet for a client, but am having some difficulty in deciding how I can most elegantly meet all of the requirements. The specification calls for an applet that can view up to 400 images (all images are small - 120 * 120 px), the view of the images can be scrolled (if not all are in the view) or scaled (zoom in and out on any area), and the images will need to 'animate' or move to new locations as sorting criteria changes. Also, I need to be able to group images into arbitrary n*n arrays and click on any image in the view (rollovers may also be necessary in the future).
    At first, I thought this would be easily solved by putting the images (JLabels?) into as many groups (JPanels?) as necessary to meet the sort criteria, then adding the groups to my main view (JScrollPane w/JPanel) in a GridLayout. My current attempt at a solution scales the groups (JPanels) via. an overridden paintComponent method from within my main scrolling view (using g2d and scale). Unfortunately, I now have many problems that I am having trouble solving:
    1. After I re-scale the JScrollPane (zoom in or out) and then try and scroll, the new images that scroll in are either garbled or just junk (seems like remnants of the original, non-scaled components?).
    2. The scrollbars, at first, were not reflecting the current scaling and how much content is visible, so I overrode the getPreferredSize method in my JScrollPane content object to return (super.getPreferredSize * scaleFactor) - this fixes the appearance of the scroll bars (ie. they accurately reflect how much content there is), but it also offsets all of the images left depending on the scale value (less scale -> images offset further left).
    3. I need pixel-perfect control over the images, so that I can animate the transition from one 'group' to another - I can't see a way to achieve this with my current solution.
    Has anyone tried to do something like this before? What is a good way of accomplishing what I need here? Any code out there that does something similar? Any help would be appreciated, I've been banging my head against the wall over this for days now...
    Thanks in advance,
    Mike P.
    Here is some relevant code:
    /* From BrowserPanel (JPanel associated with my main JScrollPane) */
    public void paint (Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        g2d.scale(scaleFactor, scaleFactor);
        super.paint(g2d);
    /* From BrowserPanel (JPanel associated with my main JScrollPane) */
    public Dimension getPreferredSize() {
        Dimension origSize = super.getPreferredSize();
        double originalSizeX;
        double originalSizeY;
        originalSizeX = origSize.getWidth();
        originalSizeY = origSize.getHeight();
        double newSizeX = originalSizeX * scaleFactor;
        double newSizeY = originalSizeY * scaleFactor;
        String strX = Double.toString(newSizeX);
        String strY = Double.toString(newSizeY);
        /* Round the string (discard anything after the decimal) */
        strX = strX.substring(0, strX.indexOf("."));
        strY = strY.substring(0, strY.indexOf("."));
        /* Convert string to int... */     
        int x = Integer.parseInt(strX);
        int y = Integer.parseInt(strY);
        return new Dimension(x, y);
    }

    I increased the frame size to 3 lines and noticed the the flickering is a result of the text area painting itself without the scrollbar and then repainting itself with the scrollbar. I don't know why this happens, but a work around is to use:
    ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,

  • EJB 2.0 RI, CMR, problem with one-to-many

    I got an entity bean with a one/many, bidirectional, non-cascading relationship to another entity bean. The "one" side is represented by the remote type of the related entity bean.
    The "many" side is represented by the type "java.util.Collection".
    Unfortunately, the Verifier spits out the following error for the "many" side:
    Error : Invalid type assigned for container managed field [ depots ] in bean [ Account ]
    "depots" is defined in AccountEJB.java via the abstract contract
    [import java.util.Collection;]
    public abstract Collection getDepots();
    public abstract void setDepots(Collection depots);
    Q1. Is there anything wrong with this?
    Q2. Does the currect J2EE RI 1.3 beta support CMR as defined in the draft2 of EJB 2.0?
    Q3. Do I need to mark the CMR fields as CMP 2.0 ("fields to be persisted") in the Deployment Tool? I'd say yes, but if I would be picky, CMR would not be CMP...
    Q4. Can anyone point me to a good example of CMR. The PetStore App uses BMP everywhere, and I could not find any other useful demos.
    I'd appreciate any help!
    Greetings,
    Andreas

    I am new to J2SDKEE1.3 CMR. I have similar question about CMR. The only example is the "customer" under the J2SDKEE1.3 doc fold. Can anyone provide more examples?
    Thanks in Advance.
    Oliver

Maybe you are looking for