I have some data in the following format:
and so it goes for about 2000 lines
I need to plot a line graph , that plots the intime for each salary code as a trend, with seperate lines for seperate salary codes. Is there an automated way to do this?
Please note that the salary codes repeat for each day. The trend required is for each salary code, not row by row.
It can be done without programming, but there is one bit of information you need to add in order for this to make sense – the date or sequence number for each entry.
Then you will be able to plot:
- salary code: the series
- date or sequence number: the x-axis
- In Time: the value / y-axis
The easiest way is with the PivotChart Wizard:
- select the (now) 3 columns and choose “Data | PivotTable and PivotChart Report..”
- select PivotChart type
- click through the wizard to completion … you should end up the raw chart page
- right-click chart are, choose “chart type” and change to “line” type
- from the “PivotTable Field List”, choose:
- date or sequence number – add to “Category Axis”
- salary code – add to the series axis
- in time – add to the data area
- By default, it will plot “Count of In Time”: need to change this
- right-click the “Count of In Time” field button widget
- choose “Format PivotChart Field”
- change to sum, average, max or min (anything that represents the actual data – it only applies to the one value so aggregate functions are fine)
- Now your chart lines should be OK, but the y-axis is just a meaningless value.
- right-click the y-axis and choose “format axis”
- go to the “Number” tab and change the format to “Time”
Voila! Lines for each salary code, plotting the “in time” trend day by day
I don’t think there is an easy way out..
the best I can do in 5 minutes is flip the columns, select and Create an XY Scatter plot.
It still won’t give you different dot colors for each employee or individual lines
I don’t believe there is an automated way to do this but possibly you could generate a third column which holds the delta between the time and some arbitrary base time (say 12:00 am or 00:00). Then chart the deltas.