+ Reply to Thread
Results 1 to 5 of 5

Pivot table Relationships

  1. #1
    Registered User
    Join Date
    02-14-2017
    Location
    Wariwickshire, England
    MS-Off Ver
    2013
    Posts
    2

    Pivot table Relationships

    Hello All,

    I'm new to the forum. My excel skills are probably ok but I'm still very much learning.

    Just started working for a new company and trying to help create a useful pivot table from two very large and useless spreadsheets.

    Ill try and keep this short. the company is a medical company so we have a spreadsheet which contains information regarding every procedure where this new product has been used. we have lots of information including the device serial number and also other information like hospital, type of procedure and then comments. Then I have a second spreadsheet that has complaints we have had with the product or something that relates to the product. on this spreadsheet we have the device serial number and then a few other columns of information regarding the hospital and comments on the issues. Both spreadsheets need simplifying so that there isn't so much free text and more uniform input so its easier to report on.

    to make it clear we have around 60 units and each unit has its own serial number.

    So knowing that both spreadsheets have the device serial number I thought I could put them both on the same workbook as different sheets and create them as tables so I could then create a pivot and create a relationship using the serial numbers. However I'm having the following error:

    "both selected columns contain duplicate values. at least one of the columns selected must contain only unique values to create a relationship between tables"

    I'm really not sure how to fix this issue. both spreadsheets will have the serial numbers repeated multiple times. on the procedures sheet the product will be used for lots of different procedures on patients and on the complaints sheet we could have had multiple issues while using the same product on different days etc. I'm thinking that this is probably why I have this issue.

    ultimately I'm trying to report on each serial number and how many procedures have been done with this serial number and work out how many complaints we have had for that product.

    fingers crossed I have explained this properly and that there is a fix. currently I can do this manually as this is a new product which have only a few sales and used only a few times but as time goes on we could be selling hundreds of these products and each one could be used multiple times a day so the work I do now will really help for the future.

    thanks in advance.

    dan
    Last edited by danieljephcott; 02-14-2017 at 11:04 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Pivot table Relationships

    Welcome to the forum, Dan. It would help a lot to attach sample spreadsheets with non-sensitive data. We don't need everything, but we do need enough data to illustrate the point. Also mocking up or describing what you want the results to look like will also go a long way to our understanding of the requirements.

    Depending I what is provided, this may or may not be a relevant question, but how do you get the data onto the sheets? Is it entered manually, imported or copied and pasted in?

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    02-14-2017
    Location
    Wariwickshire, England
    MS-Off Ver
    2013
    Posts
    2

    Re: Pivot table Relationships

    Hello Dflak,

    thank you for the quick reply.

    So I have attached the file which has two sheets on, I have had to strip back the information as this is very sensitive but I'm hoping there is enough to understand what I'm trying to achieve.

    On the attachment you will find two sheets: Complaint Data - this information has been exported from a basic online data base which the company uses to store all kinds of information. This data is entered to show issues that have happened with the product while being used in surgery.

    Procedure Data - This information is entered manually. This information provides everything about the procedure that has been preformed and at which hospital. also it will have comments from the hospital staff on the experience of using the product but also comments on what has happened in the surgery.

    you will see on both sheets that it shows the Control units Serial number for each device (Column title: CU SN). This is what I thought would be the link for the relationship.

    So what I'm trying to achieve is a report or multiple reports which shows how many times each control unit has been used in a procedures and also how many complaints that control unit has had.

    the idea is to hopefully show that at the beginning the product had more issues but in time after fixing the bugs/issues these have decreased. I'm sure there will be lots of other reports I could create by having a link between this information.

    just a quick note, a lot of the information I have stripped away are columns full of text but as I dive into this I will try and have a more uniformed way of showing the issues by having some drop downs so something can be selected. the idea is to only have one comments field rather than lots which is difficult to report on or show trends.

    Fingers crossed the information and explanation is enough.

    thanks again

    dan
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Pivot table Relationships

    There is a bit of “apples and oranges” here. We have a many-to-many relationship, For example, the Complaints data has 10 complaints for CU 101 and the Procedure data has 27 procedures.

    There is also a bit of mismatch in our date formats. Rows 2 and 4 have an actual date for Date Completed. I’m showing January 11, 2017 and July 21, 2016 respectively. These seem to be correct based on the date closed. Most of the other dates are actually strings and they are in dd/mm/yyyy format which I will have to work around with my American settings. .

    I know what is causing this: Excel is trying to “help me out” by determining what kind of data is in the cells by looking at the first several rows. When you import this data with your settings, it should come over as all actual dates. So I will convert all to actual dates and work from there.

    Now to figure out how to make sense of the data. The dates will come into play.

    As I see it, there a procedure occurs on a certain data, say June 14. If an issue occurs, it is written up and entered into the database, say on June 16. It is eventually closed, say on October 12. The problem is tying the June 14 procedure with the June 16 write-up.

    One metric I can come up with is how many times the procedure was opened after it had been closed. This would be semi-independent of the procedures performed. I saw semi because the more you do a procedure, the more likely you are to find something wrong with it.

    I’ll have to process this through the gray matter to see if I can come up with any meaningful metrics. Any insights on comparing dates and procedures you have are welcome.

    One thing however: I do see you are using tables – bravo! That makes life a lot easier.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Pivot table Relationships

    I came up with this weird metric. It joins data from the Complaints Data on the Procedure data sheet.

    I added three helper columns:

    Openings: these are the number of complaints for the CU that were opened after the Procedure Date. Naturally, this would be a declining number.

    Proc After: This is the number of procedures for the CU processed after the procedure in the same row. Naturally, this is also declining.

    Ratio: this is Openings / Proc After.

    I don’t know how valid this metric is. It does take into account causality (number of complaints opened after a procedure) and opportunity (number of the same procedure done after the openings). It’s about the only thing I can think of since there is no way that I can see of linking a complaint report to a previous procedure.

    I put this information into a pivot table and grouped the dates by month and year. I inserted a couple of slicers to make the navigation easier.

    Don’t worry about the (US) in the name of the spreadsheets. It just means when I look at it, the dates are mm/dd/yyyy format. When you look at it, the format should be dd/mm/yyyy.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 02-17-2017, 08:31 AM
  2. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  3. Help to Create Relationships in Power Pivot
    By rv02 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-17-2015, 06:15 AM
  4. Replies: 1
    Last Post: 07-29-2015, 05:19 PM
  5. Pivot table relationships between source table data
    By LizzyJ in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-13-2015, 09:56 AM
  6. Calculating relationships in a table
    By daddylonglegs- in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2010, 09:27 AM
  7. Table relationships in Excel?
    By saturnius in forum Excel General
    Replies: 3
    Last Post: 01-26-2005, 08:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1