Skip to main content

Morning all!

 

Ok so I am just a beginner in Tableau. I have developed the underlying Access database that tracks the inventory for wireless devices for my company.  In the database there is a table of employees, table of inventory, and a table of monthly usage costs.  I have an additionally table that shows custody (which device is assigned to which employee).  The device ID is the key to making the relationships in the database work.

 

I am trying to create a view of the inventory of devices.  To do this I bring in the Org Name to rows, and the device type to columns and a count of device ID to columns and that gives me a basic bar chart.  I figured that a count of devices would work and Wala!  My first view.  What I am finding is that Tableau is counting the device ID in the inventory table plus the device IDs that show up in the monthly costs.  So currently I have 5 months of data in the db, which is equaling a total of 6 device IDs when it should be one.  Any advice on this?

 

Additionally, my database is set up with a one to many relationship.  So for each device in the inventory table, there is only one device ID as it is the primary key.  When you look at the custody table you see many device ID as the phone can be assigned to many employees.  In Tableau I show this as an inner join.  Is this correct?  I have played with left and right joins and it seems to no make a difference in my counting.

 

Thanks in advance!

 

Scott

답변 4개
  1. 2017년 7월 26일 오후 6:15

    Srinidhi,

     

    You are correct....when I look at the inventory I want to see one occurrence of a device and 5 occurrence of that device in the monthly cost table.  What is happening is that when I pull in a count of deviceID, Tableau is counting the device ID in both tables.  I am using an inner join on the device ID.  I tried another approach by building a query for the specific needs (inventory, monthly costs, etc.)  I connected to the database multiple times but brought in only one query each time.   Each time I brought in the query, I joined via inner join to the related field and this gives me the result I want.  Why?  Don't know but it works.

0/9000