7 Replies Latest reply on Jun 29, 2018 1:17 PM by Deepak Rai

    Sum Calculation from Multiple Data Sources

    Diane Royer

      I am working on a large workbook that contains multiple data sources.  One data source contains the net student contribution to the university by year, one shows the number of credit hours each student has taken a year, and one shows the courses available for a year.  I have a calculation that divides the student net contribution by year and divides that by the number of credit hours taken.  This calculation works great as long as I have the student ID number in my view.  I tried to add this calculation to a worksheet displaying student contribution per course (this worksheet lists course instead of student ID number).  I added my calculation to the sheet and instead of summing the results, it seems to be giving me an average (i.e. it shows 325 when it should be showing 7869).  When I try to do an LOD calculation, Tableau tells me it can't do that with information from two different data sources.  When I try to simply sum the calculation, Tableau tells me that the calculation is already an aggregate and cannot be further aggregated.  Is there a way to get it to sum this calculation by course?

       

      The calculation for student contribution by credit hour is -- SUM([IND_STUDENT_CONTRIBUTION].[STUDENT_NET_CONTRIBUTION])/SUM([YR_CREDIT_HRS]).  I just want this number to summarize by course.  So, for example, if 5 students took a course that was 3 credit hours, student 1 paid $10 per credit hour, student 2 paid $15 per credit hour, student 3 paid $5 per credit hour, student 4 paid $10 per credit hour, and student 5 paid $20 per credit hour -- the number I want to see is $180 (each dollar amount times 3 and added together).

       

      Is there a way to accomplish this?

       

      Any assistance you can provide would be greatly appreciated.