Vizlib Gantt is a 100% data-driven solution leveraging Qlik's powerful associative data engine. To use Vizlib Gantt on top of your own data model, you must ensure some prerequisites are met, and certain dimension fields are available in your Qlik Sense app.
TABLE OF CONTENTS
Building the Chart
Build your own Vizlib Gantt-ready load script:
Events: Load date(floor((today() - (ParentGroupNum*20 * (rand()) )))) as StartDate, date(floor((today() + (ParentGroupNum*20 * (rand()) )))) as EndDate, * ; Load 'Event ' & ID as Event, Pick(Ceil(3*Rand1),'1','2','3') as ParentGroupNum, Pick(Ceil(3*Rand1),'A','B','C') as ParentGroup, Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Group, Pick(Ceil(3*Rand()),'X','Y','Z') as SubGroup, rand() *1000 as Cost, Pick(Ceil(3*Rand()),'Jo','Jack','Jill') as Resource, * ; Load Rand() as Rand1, Rand()*5 as RandWhole, IterNo() as LineID, RecNo() as ID Autogenerate 100 While Rand()<=0.5 or IterNo()=1;
Data Model Definition
The key fields which Vizlib Gantt can read include:
Field Name | Supported Types | Description | Needed | Field Name in example file |
[Events] | $text, $ascii, $numeric, $integer | This is the unique identifier or name of the event, project, or task. This field represents the main driver of the Gantt. | Required | [Event] |
[Start Date] | $timestamp, $date | This field defines the start date of the event, task or project. | Required | [Start Date] |
[End Date] | $timestamp, $date | This field defines the end date of an event, task or project. If omitted, events will not expand over a timeline and will appear as static single-day events | Optional | [End Date] |
[Group] | $text, $ascii, $numeric, $integer | This field organizes events, projects or tasks into a hierarchical group. Groups can be expanded or collapsed, just like in a pivot table, and individual events are aggregated to a group view. | Optional | [Phase] |
[Sub Group] | $text, $ascii, $numeric, $integer | This field allows you to create a multi-level hierarchy and works in exactly the same way as the [Group] field. Sub Groups are organized at one level below the [Group] field. | Optional | [Group] |
[Parent Group] | $text, $ascii, $numeric, $integer | This field allows you to create a multi-level hierarchy and works in exactly the same way as the [Group] field. Parent Groups are organized at one level above the [Group] field. | Optional | [Plan Type] |
[Event Type] | "event" or "milestone" | The Vizlib Gantt supports different representation types such as events or milestones. This can be driven dynamically by defining the type in the [Event Type] field. At the moment there are only two types supported, and more will be introduced in due course. | Optional | Qlik expression |
[Predecessor] | $numeric | Using Predecessors in the Vizlib Gantt to create dependencies. You must have the [Events] defined as the order number so that we can draw the dependent links. | Optional | [Plan Type] |
Further to the above fields, you will be able to define many more settings or properties dynamically via expressions, such as the background colors for each event. Those expressions can be variables, calculations or even simple dimension values.
Vizlib Gantt - Example
Example Dataset
Please find the attached datasets at the bottom of the page.