The Spotfire Community is moving to TIBCOmmunity and this forum location has closed. During the transition, you can still search the old forums but posting has been disabled. We encourage you to pick up the discussion at the new Spotfire community on TIBCOmmunity.
October 2012 - Posts - Tip of the Week

Tip of the Week

October 2012 - Posts

  • Adding Bullet Graphs to Graphical Tables and Text Areas in TIBCO Spotfire

    Do you use dynamic items, a concept introduced in TIBCO Spotfire 4.0 and discussed in a previous tip of the week? These items, that is, sparklines, icons and calculated values, are available in Graphical Tables and Text Areas intended to provide dynamic information in a condensed format. In TIBCO Spotfire 4.5, a fourth dynamic item is obtainable; the bullet graph.


    A bullet graph offers a visual comparison of two values on an axis. One value is represented by a horizontal bar along the axis, and the other value by a line placed vertically to it.

    Let us give a hint of how bullet graphs can be useful to, at a quick glance, get an overview of the current situation. Do remember that the bullet graphs are dynamic, that is, respond to changes like filtering!

    Below you have sparkline columns in a graphical table presenting on a monthly basis Sales and Cost respectively for a number of different fruits and vegetables.

     

    Assume you are interested in comparing total Sales and Cost figures over the period, but only on a very sketchy level.  Instead of displaying and comparing the actual Sales and Cost amounts, which you can do by means of adding a calculated values column, add a bullet graph column! Let the bar in the bullet graph illustrate Sales and the vertical line Cost.  (How to add dynamic items to a graphical table is described in the tip of the week titled Information at a Glance with Graphics Tables.)


    Open the Bullet Graphs section in the Bullet Graph Settings dialog (in the Graphical Tables Properties dialog, the Axes section, add a Bullet Graph, then select the Bullet Graphs section in the opened Settings dialog). Specify what to display as the bar in the bullet graph via the Calculate values using selector, what to indicate by the line via the Calculate comparative values using selector, and which colors to use:
     

    As you can see in the graphical table below, the resulting bullet graphs tell us Sales exceed Cost for all types of fruit and vegetables.  It seems selling all types is moneymaking, and selling bananas generates highest sales amount.
     

    Now let us elaborate this a little bit further. Say, if you consider other expenditures, you have to add 20% to the cost prices to cover up for extra expenses. Is selling all types of fruit and vegetables still profitable? To answer the question, add another bullet graph to the graphical table where the vertical line shows Cost multiplied by 1.2. (To enter the expression, right-click the selector to open the Custom Expressions dialog.)


     
    If you look at the added bullet graph column below, it is obvious at a quick glance you would lose money if selling only bananas, as expenditures and purchase prices are not covered. Instead it seems you should go in for selling more pears!


     
    Finally, bullet graphs can be added also to text areas in the same way as other dynamic items. Note that in text areas, a scale is added.


     
    To learn more about bullet graphs and other dynamic items, please consider taking any of the Mentored Online Training courses.

  • Performing a YTD Comparison on a Partial Year

    One common question we see a lot is how to compare and analyze data from one year to the next. There are a variety of ways to do this. Let’s assume we have data like shown below, which includes transactional data of sales by sales rep and by region for 2011 and 2012.


    If we want to analyze the results per region, for example, we could create a Bar Chart which shows Region on the Category-axis,  and  Sum ([Total]) on the Value-axis. We can additionally color by Year([Order Date]).

    You will notice that the sales are all less in 2012, in some places significantly less. If we take a look at the raw data, we can see it is because the results for 2011 are complete, but at this given point in time, we are still in 2012, so we don’t have data through the end of the year.


    What if we want to compare how we are doing so far this year compared to the same time period last year?  Using a simple calculation, we can build a calculated column, called ‘Adjusted YTD’ which will show data only if the day of the year for 2011 is before today’s date in 2012.

    if(DayOfYear([OrderDate])<=DayOfYear(DateTimeNow()),[Total],0)

    If today is October 14, 2012, it will output sales totals for all rows in 2011 where the date is October 14,2011 or earlier, but for October 15th,2011, for example, it will output 0.


     
    We can then update our Bar Chart to use the Adjusted YTD Calculated Column  on the Value-axis, so that we can properly show an Actual YTD comparison.


    If we now want to show the just a single bar which shows the difference between the Adjusted YTD this year versus last year, we can use the following custom expression on the Value-axis:

    Sum([Adjusted YTD]) - Sum([Adjusted YTD]) OVER (Previous([Axis.Color]))


    Interested in learning more about calculations and custom expressions in order to generate your own analysis? Please consider taking our SP141 Computational Analytics training course. This is offered onsite with a live instructor, and online, using our new Mentored Online Training format.

Syndication

Other Spotfire Blogs

©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center