Twitter/Facebook

Pinterest
Friday, October 3, 2014

This post is about creating a Gantt chart in Qlikview.

Gantt Chart according to google is
  1. "A chart in which a series of horizontal lines shows the amount of work done or production completed in certain periods of time in relation to the amount planned for those periods." 


Let's take a simple example: A chart to show the tenure of chief ministers of Tamil nadu. 


Script 


LOAD "#[9]", 
     "#[9]1", 
     Name, 
     Portrait, 
 [Took office],
 [Left office],
Date(Date#(SubField([Took office],'[',1), 'DD MMM YY'), 'M/D/YYYY') as TookOffice,
Date(Date#(SubField([Left office],'[',1), 'DD MMM YY'), 'M/D/YYYY') as LeftOffice,
     "Term[10]", 
     "Political party[26]", 
     Election
FROM
[http://en.wikipedia.org/wiki/List_of_Chief_Ministers_of_Tamil_Nadu]
(html, codepage is 1252, embedded labels, table is @3);


Steps:

1.Create a bar chart

Dimensions: Name, Election
Measure: interval(LeftOffice-TookOffice,'DD') that is the difference between your dates
in bar offset give the first date( the second in the subtraction of interval)



In style- select orientation as horizontal 

uncheck forced zero

Change the format of interval to date and in the format pattern change it to DD/MM/YYYY


Result: We get the list of CM's, their tenure as a gantt chart.

0 Scribbles:

Post a Comment

Thank You for taking pains, commenting :)

LinkWithin

Search This Blog

 
badge