3 Replies Latest reply on Feb 27, 2017 2:14 AM by Isobel Milner

# Weighting in SPSS vs Tableau

Hi,

I have a data file in SPSS which has a group of measures in it. I also have a weighting variable which I apply in SPSS before running my analysis.

I want to put this data into Tableau and apply the same weight. I take the raw measures and multiply them by the weight. I then transpose the file to put it into Tableau.

Within Tableau I calculated a weighted average using the formula

SUM([Measure])/(COUNT([Measure])*3) as my data contains data for 3 years and use the Aggregate of this in my table.

This gives an output very similar to that in SPSS but not identical. My question is, could this difference be due to a difference in the two methods or should they give exactly the same output?

Is there a better method to use to apply this weight to my data?

Could the difference only be due to a difference in the data i.e. an error in the transposition?

I'd be grateful for any help/ thoughts

Thanks

• ###### 1. Re: Weighting in SPSS vs Tableau

Hello Isobel,

I am not familiar with SPSS but one thought is that the count() of a measure won't include NULL values for that result for the measure.  How does SPSS handle nulls?  and do you have any in your data?

Patrick

• ###### 2. Re: Weighting in SPSS vs Tableau

also.   I'd try to figure this out by using smaller amounts of data to see if they match up when using a single day vs 3 days.. work from 'working' up to not working to help figure out the cause.

Patrick

• ###### 3. Re: Weighting in SPSS vs Tableau

Hi Patrick,

I have now figured out what the formula needs to be.

It is SUM([Measure])/(SUM([Weight]))

As I’d already multiplied my measures by my weight I then needed to divide it by the sum of those weights once it is in Tableau.

I also made sure the sum of my measure times the weight in Excel matched the same output from SPSS before I put it into Tableau.