Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
hic
Former Employee
Former Employee

Have you ever wanted to create a Gantt chart in QlikView, only to find out that this chart type is not one of the pre-defined charts? Then you should be happy to learn that it is possible to create a Gantt chart and that it is not very difficult.

 

To be able to create this chart, you need some type of event in the data model, where each event has a start date (or time) and possibly also an end date. Further, an event should belong to some grouping, typically a project or a phase in time.

 

Gantt.png

 

Given the above, we can now start making the graph:

  • Create a bar chart with the appropriate event grouping as dimension (e.g., project, phase, or other group of events)
  • Add the duration of the project as expression: Max(EndDate)-Min(StartDate). If you only have one date per event, you just replace both StartDate and EndDate with the date that you have. The duration will then be the time between the first event and the last.
  • Add the start of the project as an offset to the bars: Min(StartDate). [Chart Properties-Expressions-The plus sign to the left of the Expression-Bar Offset]
  • Set the graph orientation to horizontal bars. [Chart Properties-Style-Orientation]
  • Remove the “Force 0” option. This option will force the start of the time axis to be Dec 30th 1899. [Chart Properties-Axes-Expression Axes-Force 0]
  • Format the expression axis labels as dates or as months (e.g. M/D/YY or YYYY MMM). [Chart Properties-Number-Date]

 

Now you should have a Gantt chart. If you want to improve the way it looks, you may want to consider the following suggestions:

  • Add a grid. [Chart Properties-Axes-Expression Axes-Show grid]
  • If you want a label on each bar, add a second expression defining the text for the label and use this as “Value on Data Points.” [Chart Properties-Expressions-Display Options]  Don’t forget to disable the “Bar” option for this expression. This is the first check box in the Display Options group.
  • If the chart shows a range which is too large, add static min and static max to define the display range of the expression, e.g. Min(StartDate)-5 and Max(EndDate)+40, respectively. The additional distance on the upper limit is to leave space for the text. The unit is number of days. [Chart Properties-Axes-Scale]
  • If you have a second dimension, you can add this too. But if you do, make sure you use the “Grouped” option and not “Stacked.” The latter does not work well with bar offsets. [Chart Properties-Style-Subtype]
  • You may want to use the same color within each value of the first dimension, e.g., one color per project. One good way to define the color (e.g. RGB values) is to do it already in the dimension table in the script and use this color in a color function in the bar background color, e.g. RGB (ProjR,ProjG,ProjB). [Chart Properties-Expressions-The plus sign to the left of the Expression-Background Color]

 

This Gantt chart solves most cases where you need to display that duration of a group of events. Should you need a more complex Gantt chart, you may need to make it as an extension object instead.

 

HIC

56 Comments
andyquirin
Partner - Contributor III
Partner - Contributor III

Brilliant! Easy fix - updated the min axis to MIN(Proj_Start_Date) and solved everything.

Thanks for the quick follow up.

0 Likes
4,108 Views
Not applicable

Lee,

Thanks for the description, but I have two problems:

the chart does not open and says: unknown diagramm type

I cannot open the settings of the report

Bernd Haak

0 Likes
4,108 Views
Lee_Matthews
Former Employee
Former Employee

Hi Bernd

That seems to happen sometimes when just copying the existing app to access point. The simple solution is to delete the chart and then add a new one and configure it as per the notes.

Sent from my iPhone

0 Likes
4,089 Views
Not applicable

Lee,

ok thanks

Bernd

0 Likes
4,089 Views
Anonymous
Not applicable

I am unable to get continuos x axis values .. all worked well ..except that i want to show all months in an year instead of consecutive ...can someone please help....

0 Likes
4,089 Views
Not applicable

Thanks for the examples and sample qvw above.

I was able to successfully get to the Gantt Chart... However I was not able to change the orientation of data values as you have displayed horizontally... My Data values are displayed vertically. I tried changing labels orientation... under [Chart Properties-Axes-Primary/Secondary Dimension labels]

All help is appreciated...

0 Likes
4,089 Views
hic
Former Employee
Former Employee

The only orientation that I have changed is the graph orientation under [Chart Properties-Style-Orientation].

HIC

0 Likes
4,089 Views
Not applicable

Thanks for your reply...

I was able to change the values by selecting...  [Chart Properties - Presentation - Values on Data Points] and uncheck the option Vertical...

Thanks


0 Likes
4,089 Views
Not applicable

Would like to add my own attempt at a Qlikview Gantt Chart using an extension.. as if there wasn't enough ways:

http://webofwork.com/index.php/19-qlikview-tips-and-tutorials/90-qlikview-gantt-chart

ganttv1.PNG.png

4,102 Views
hectorgarcia
Partner - Creator III
Partner - Creator III

I did not realized we can do this with QV, this way we can add value to the PMO visualizing with QV technology their projects!!!

4,102 Views