gantt chart

The IBM Rapidly Adaptive Visualization Engine (RAVE) is a new tool introduced in Cognos 10.2.1. The engine can run on the server or the client, allowing for the dynamic creation of both static and active charts. Additionally, visualizations can be tweaked to allow for new charting options on the fly. IBM’s AnalyticsZone website provides a large number of downloadable visualizations, and one of the available options is Gantt charts. The standard Cognos 8/10 charting engine does not provide this type of chart, so this is a great opportunity to expand what Cognos can do.

To create Gantt charts using RAVE requires Cognos 10.2.1 or newer. Additionally, an administrator needs to download the Gantt visualization from AnalyticsZone and install it in the local Cognos installation. Click here for a previous article with more detailed instructions on downloading visualizations.

Gantt charts usually show a timeline for various tasks, with each row representing a single task. If tasks are broken into parts, those parts appear on the same row, each with a different color. Gantt charts use a different type of data than most reports. Transaction data, such as orders and sales, doesn’t really fit into this format well. Regardless of this difference in priorities, however, there are still many situations in which a Gantt chart provides great insights into your data. In a list format, Gantt chart data might look like this:

task table

The Gantt visualization takes each of the above columns and uses them to create an easily consumable display of the information. To ensure that the Gantt chart displays properly, you should follow the requirements described below.

 

Populate All the Elements in the Visualization

Each of the visualization’s data elements must be populated before it generates. If they are not, the chart may display with no data or may take a very long time to generate. If you are trying this visualization and the report takes too long to run, make sure you filled in all the data elements! The table below shows the four data elements that structure the Gantt visualization.

data elements

Knowing what information to enter in these fields is not always intuitive. Be sure to take the following guidelines into consideration when filling them in.

Don’t Use Dates in the Start Date and End Date Fields

It is very important to note that the Start Date and End Date fields do not actually take date values – they take a number equal to the number of days since January 1, 1970. These values are converted to dates internally and used to create labels for the visualization. Cognos can convert dates into numbers using the _days_between function, as shown below:

_days_between([Date Query Item], 1970-01-01)

If you expect to be using a lot of Gantt visualizations, it may be worth adding this calculation to your warehouse’s date dimension so that report users can drag and drop it onto their reports. Ideally this would be placed as a field in the date dimension database table, but you could also add the calculation in Framework Manager.

If your data does not contain a series (for example, if each task has only a single phase), create a query calculation with a static text value and place it in the Series element of the visualization. If you leave this element blank, the chart will not render.

 

Change the Label Value Ranges

The initial value ranges for the chart labels should be changed. By default, the visualization includes data down to zero, which in this case means time values all the way back to 1970. You can change the Value Range property by selecting the Start date or End date field in the visualization and then clicking on the ellipsis next to Value Range under General in the Properties pane.

Gantt Charts format

In the Value Range dialog, make sure that the “Range includes zero” checkbox is unchecked. This needs to be done for both the Start date and End date elements.

value range

 

Sample Gantt Chart Using GO Sales Data

To provide a good example of a fleshed out Gantt visualization, we’ll create a chart using Cognos’s GO Sales sample data set. This data is not really designed for Gantt charts, so we’ll do some creative grouping in order to create something more appropriate.

Open Report Studio with the GO Sales (query) package. Create a blank report (there is no “visualization” report template, so a blank report is usually best when using RAVE).

Note: If you are running Cognos 10.2.1, RAVE is only available in Active Reports. Create a blank Active Report instead; all the other steps are the same.

Open the query in the Query Explorer and add the following data items:

• [Sales (query)].[Products].[Product line]
• [Sales (query)].[Time].[Date]
• [Sales (query)].[Time (ship date)].[Date (ship date)]
• [Sales (query)].[Time].[Year]

In order to meet the format requirements for the Gantt chart visualization, we need to add two query calculations that transform the dates into “days since Jan 1 1970” values:

gantt charts expressions

 

Make sure to set the Aggregation property for each query calculation as described above. This will combine the many orders in the GO Sales data set into a small number of groupings, which is more appropriate for a Gantt chart.

To create a series for this data, we will use the quantile function to split the orders into 4 groupings. (The quantile function breaks up data into some number of segments and returns the segment that each data item falls into.) Create a query calculation called “Phase” with the following expression:

'Phase ' + CAST( quantile(_days_between([Date], 1970-01-01) , 4 
for [Product line]) as varchar(10))

Set the Aggregation property for this query calculation to None, so Cognos knows to treat it as an attribute.

To make the data look more like a “waterfall” project, where different tasks happen after each other, add the following filter expression:

([Product line] = 'Camping Equipment' AND [Year] = 2010)
OR 
([Product line] = 'Golf Equipment' AND [Year] = 2011)
OR 
([Product line] = 'Mountaineering Equipment' )
OR 
([Product line] = 'Outdoor Protection' AND [Year] = 2012)
OR 
([Product line] = 'Personal Accessories' AND [Year] = 2013)

Go back to the report page and add the RAVE Gantt visualization. Make sure the Query property for the Data Container is set to the query you were just editing, and then drag the query items into the right places:

query items

In the end the Data Container should look like this:

gantt data

Note: Don’t forget to change the Value Range property for Start Date and End Date to not include zero.

By default the visualization is sized at 500×500. You may want to change this – click on the visualization and change the Width property to 1024 (or something else based on your screen size). You can also click and drag the bottom right corner of the visualization on the project pane to resize it.

Run the report and you should see a well-formatted Gantt chart similar to the one below.

gantt chart RAVE

 

As mentioned earlier, the Gantt visualization requires all fields to be populated. Try deleting the “Phase” item from the Series box and running the report again. This time, you should see a chart with the right date range, but no data. For data not in a series, you can add a query calculation with a constant value (like ‘Project’) so that the data will display.

Gantt charts are a useful item to have in your toolbox and are very different from other chart types. When one is needed, remember the tips in this article. They will help you ensure a smooth implementation in any situation.

If you have any further questions about Gantt charts or RAVE in general, please reach out to us. Ironside would be happy to help you successfully leverage the exciting new visualization options that RAVE provides. For wider data visualization and dashboarding advice, check out the following resources:

 

9 replies
  1. Andre Starker says:

    Thank you very much! This was extremely helpful; I couldn’t figure out how to make the chart work until I came across this article. I wish there was a way to change font, labels orientation/truncation, and make the size in %.. Hopefully next version.

  2. Scott Smith says:

    Thanks for this! I was wondering if you know about using a RAVE visualization to express a u-chart? When we upgrade, we’ll lose the one from the SPSS for Cognos Statistics package and we’re trying to figure out how to replicate it in 10.2.1
    Cheers,
    Scott Smith

  3. Mina F. Beshay says:

    Ironsidegroup, thanks for this great article. But I’ve a question, why don”t you post an article about how to customize the new RAVE charts using customization tool provided by IBM ?

  4. Administrator says:

    Daan and Scott,

    Glad you both liked the article! If there is interest we will definitely supply more explanations – I wanted to put the Gantt one out there first because it’s a new chart type and it seemed likely there would be demand. What other visualizations are you most interested in?

    Daan – the current visualization will only work at the day level or “above”. At present there’s no way to express hour/minute/second values to the visualization.

    — Geoff

  5. Bruno Abuaf says:

    Good Guide. Well done!
    I’m customizing the look&feel of this RAVE.

    Some questions that could be useful to anyone.
    Do you know if it is possible to:
    1) change timeframe in X axis: e.g. from days to hours or weeks
    2) show weekend (not working days) as a vertical continous bar
    3) add a “nested-level” in Y-category: e.g. Main Task A is divided in 3 SubTasks: B, C and D (Now I’m using a different level of data, shown in different charts)
    4) change “icon” for some key task: e.g. : Kick Off, Mid-term Milestone; Go-Live)

    Thanks in Adavnce

  6. Daan Blinde says:

    good news : smaller increments are possible.

    Just add the hours divided by 24 to the measure-fields.
    The chart automatically adjust the x-axis information !

  7. daan says:

    Finally a proper guideline how to use the gantt chart with cognos!
    Thanks a lot, it has been very helpfull.

    Is it possible to use the chart on a smaller increments than days ? I’d like to use it on hours or minutes in order to display the duration of our load-packages for our datawarehouse…

    regards
    Daan Blinde

  8. Scott Taylor says:

    I really like the new visualizations in Cognos but the instructions are basically nil. You explanation of the this one visualization is terrific and I look forward to the same detail for the other viz that are available. I guess I’m assuming there will be more explanations coming? Please keep up the great online help!
    Thanks – Scott

Trackbacks & Pingbacks

  1. […] Gantt Charts using Cognos 10.2.1 RAVE Technology […]

Comments are closed.