Visokio website     Downloads     Video tutorials     KnowledgeBase  
Variables: Switching measures for multiple charts on a single tab - Visokio Forums
Variables: Switching measures for multiple charts on a single tab
  • AndyS September 21, 2011 8:43AM
    Hi,
    I have a tab with 4 pie charts, split on categories with a single measure; I'd like the user to be able to switch the measure for all 4 charts with a single action, rather than having to switch it for each chart independently. (Ideally, I'd like this functionality on any combination of views within a tab)

    The first tab of "Retail-Coffee sales" demo serves well as an example of what I'm trying to achieve - I'd like to be able to select "Sales ($)" or "Total Bags" across all four charts with a single action.

    Is this possible?

    Thanks,
    Andy
  • 7 Comments
  •     steve September 21, 2011 8:56AM
    If you de-pivot your data, you can allow this through a filter. See Data > Operations > De-Pivot.

    In your example, this data:
    1 $500 23
    2 $300 17

    would become

    1 Sales $500
    1 Bags 23
    2 Sales $300
    2 Bags 17
  • AndyS September 21, 2011 9:14AM
    Sorry - I don't understand how that changes the measure that the views display ?.

    Perhaps I was unclear:

    My data set already contains all the measures I want (there are actually 7 of them, and for the most part they aren't calculated from each other)
    The 4 charts show the same measure, but split by 4 different categories (similar to the coffee demo).

    What I'm trying to achieve is to switch that measure for all 4 charts in a single user action, whilst retaining all of the rest of the chart settings.

    Currently, the users have to select the measure drop-down and change it for each chart seperately, which is a little cumbersome; What I'd like to achieve is a single drop-down to select the measure for all 4 of the charts.

    I have a similar requirement for several of the views across the dozen-or-so tabs in my presentation.

    Thanks,
    Andy
  •     steve September 21, 2011 9:31AM
    De-pivot will allow you to convert (e.g.) 10 records with 7 measures, into 70 records with 2 fields ("Measure name" and "Value"). You configure every chart measure to be "Value", then allow the user to filter by "Measure name" (or, if possible, pane by "Measure name" in a single chart).

    Save your work, then try it. Go to "Data > Operations > De-pivot", enter "Measure name" as the pivot series field name, "Value" as the pivot values field name, and select your 7 measures.

    You may not be able to make this kind of data manipulation due to your other views, but this approach will definitely solve the problem you've described in isolation. You certainly can append the de-pivoted data if you want to create a file containing both data structures.
  • Guy_Cuthbert        Guy_Cuthbert September 22, 2011 7:09AM
    Andy

    We face this one a lot, and have now adopted a standard approach to this:

    1. Add a variable called "Analyse by" (or similar) as a "text choice" type
    2. Add to it all of the measures you might want to analyse by
    3. Add a formula field called "Analyse by Value" (or similar)
    4. Set it's formula to a big IF statement which links the variable to the field in the data which contains the measure
    5. Show the Variable on your filter bar
    6. Change your pie views (or any other views) to split by the "Analyse by Value" field

    A few caveats:
    * If you have "nice" field names you don't need the big IF statement, and can simply evaluate the field name instead (neater code, but less flexible)
    * The attached example has the necessary work done in the Data Manager - I would always do it here (for manageability), but remember to set the "Preseve Formulas in Output" option on the Field Organiser block!!

    The attached example should illustrate this... feel free to contact me if not!
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: guy.cuthbert@atheon.co.uk
    t: +44 8444 145501
    m: +44 7973 550528
    s: guycuthbert
  • AndyS September 27, 2011 6:48AM
    Many thanks Guy - that's done the trick nicely!
  •     Alk September 30, 2011 5:34AM
    Thanks, great workaround Guy :)
  •        benjamin October 5, 2011 4:59AM
    This is a standard approach one can take to have a set bar/graph view and then change the measure outputed on each graph by haveing a variable choice on the side.

    This is also good for splits as well , depending on your dataset.You can have a filter which shows data monthly,YTD,Financial YTD etc .... just by simple click on RHS of variable ..simlarily for stacks ...

    Also from memory you can have a saved query which reference variable dependeant fields....

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership