3 Replies Latest reply: Apr 23, 2013 4:44 PM by David Koschei RSS

    Fast swap between average and median?

    David Koschei

      Hello,

       

      I have 4 bar graphs in a container showing ticket age by month.  Each bar graph is slightly different, but they are all using avg ticket age.  I would also like to show Median ticket age.

       

      Rather than create 4 new tabs in the container, or create a container of containers, I'd like to be able to leave just the 4 charts, and have some kind of variable listbox or slider or something where the only two options are median and average.  Then, if the user selects median, all 4 charts will show median, and if they select average, all 4 charts will show average.

       

      I assume in the bar graph expression I can do something like:

      =$(vAvgOrMedian) & (TicketAge)

       

      I just don't know how to go about allowing the user to click for vAvgOrMedian

       

      Thank you!

        • Re: Fast swap between average and median?

          One way to handle this is to create the chart twice (or just once, and copy / paste.) Use the Layout tabs to set 'Conditional' to vAvgOrMedian = 'average' and vAvgOrMedian = 'median' respectively.

           

          Then create a text object, select actions, go to 'external', and use 'set variable'. This will allow you to change the variable's value when the text object is clicked on.

          • Re: Fast swap between average and median?
            Kent Shook

            There's a few different ways to handle this:

             

            1) Just use a cyclic expression group - Write another expression that uses the median instead of the mean, and drag one on top of the other. In the chart, you'll see a circular arrow icon that you can click to switch between the two.

             

            2) Make the expressions conditional, so that each one shows based on the value of a variable like vAverageOrMedian. (More on this below.)

             

            3) As other_peoples_shoes said, you can create entirely separate objects and use a conditional show/hide in the Layout tab based on a variable as well.

             

            For both (2) and (3), you can just do something like this:

             

            _AverageOrMedian:

            Load _AverageOrMedian Inline[

                 _AverageOrMedian

                 Average

                 Median

            ];

             

            And then create a list box with the "Always One Selected Value" box on the General tab checked. If you haven't already, be sure to add

             

            Set HidePrefix = '_';

             

            to your script, that'll keep the user from seeing the Average or Median selection in the Current Selections box.

             

            Hope this helps!

             

            Kent