# Linking Primary Data Source to Secondary Reference Table - Data Blend

**Ed Kukec**Nov 4, 2013 8:33 AM

**Note: I posted this question several days ago but got no replies....I'm on a tight deadline so needed to repost to get a response. If Joe Mako and/or Jonathan Drummey see this...please help!!**

Hi All,

I've attached a sample packaged workbook with a Data Blending Problem I need to fix. I have two data sources, one is the primary data source which has a count of hospital discharges and a count of 30 day readmissions by Month and by Hospital. I also calculate a readmission rate (readmits/discharges). What I need to do is link the count of hospital discharges, which is a measure, to a reference table (secondary data source) which is a replication of the Students T Table with a Critical T Stat value for every Degree of Freedom. Essentially, what I've done is create another calculated field called "Total Discharges (N-1) Degrees of Freedom" in my primary data source. All this does is take the total sum of hospital discharges and subtracts 1 from it. I want to link (data blend) this measure to the "Degrees of Freedom" dimension in the Secondary Data Source to grab the Critical T Stat Measure and attach it to the table I've created. Long story short, I'm trying to calculate 95% confidence intervals using the Critical T Stat. If I'm able to grab the Critical T Stat then I can create a calculated field to calculate the Confidence Interval of a Proportion which is a pretty easy calculation but thus far I can't seem to be able to do this data blend to grab the Critical T Stat and attach it to my Total Discharges (N-1) Degrees of Freedom measure in the Primary Data Source.

So when you open up the packaged workbook, you'll see the first row and column, "Central Zone Hospital 1 for April 2003" with Total Discharges = 1008 and Total Discharges (N-1) Degrees of Freedom = 1007. In the secondary data source (Students T Table) the Critical T Stat would be = 1.9623225064.

If I can get this to work, in addition I would need a type of case statement that defaults the Critical T Stat to 1.96 if the Total Discharges (N-1) Degrees of Freedom measure is > 500,001 because I have 500,000 degrees of freedom possible in my table.

Hope this makes sense. I'm using Tableau 7 at present. Any help or recommendations would be much appreciated.

Thanks,

Ed