4 Replies Latest reply on Aug 28, 2013 10:54 AM by Kennen Gross

    Reference lines

    Kennen Gross

      I have a chart with data for select schools displayed. I want to add a reference line that shows the average value for all schools in the database not just the select schools being shown. Any advice on how to get the reference line to reflect this value?

        • 1. Re: Reference lines
          Tracy Rodgers

          Hi Kennen,

           

          One way to do this would be to use a static reference line where you input the value manually. Another option would be to use a combination of hiding the unwanted schools (as opposed to filtering them out) and using the window_average.

           

          Hope this helps!

           

          -Tracy

          • 2. Re: Reference lines
            Kennen Gross

            Thank you Tracy. Do you know how I would go about getting the window average calculated? Window average is not an option in the Edit Reference Line screen.

             

            Thanks,

            Ken

            • 3. Re: Reference lines
              Tracy Rodgers

              Hi Kennen,

               

              Oops sorry! You'll need to create a calculated field similar to:

               

              window_avg(avg([Value]))

               

              Then, place it on the level of detail shelf. It will then be available in the reference line dialog box.

               

              -Tracy

              • 4. Re: Reference lines
                Kennen Gross

                Making matters a bit more complex is the fact that I have a Parameter that changes the variable. This I want the average for to change when the variable is changed.  I created an PSSA Math Average that is set to match the variable variable selection criteria.  When I take a look at the median values shown on the reference line they do not match the median values when I calculate them separately. Here is the project link so you can see the details. http://public.tableausoftware.com/views/Example_25/PSSAMath?:embed=y&:display_count=no

                 

                 

                CASE[Grade Level (Math)]

                WHEN "3rd Grade" THEN  WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 3rd grade)]))

                WHEN "4th Grade" THEN WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 4th grade)]))

                WHEN "5th Grade" THEN WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 5th grade)]))

                WHEN "6th Grade" THEN WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 6th grade)]))

                WHEN "7th Grade" THEN WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 7th grade)]))

                WHEN "8th Grade" THEN WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 8th grade)]))

                WHEN "11th Grade" THEN  WINDOW_MEDIAN (SUM([% Advanced & Proficient ( Math 11th grade)]))

                END