Hello-
I did post this on the crystal forum however it really involves setting up a good structured table in order to get the data to report on which I think we need to change which is why I'm posting here.
I am not a dba but I work with crystal reports and we are working together to get data in tables that we can report on. We are in the process of creating a data warehouse, which will mainly be summarized data we are exporting out of our legacy system and importing into a mysql database. Most of this data will be summarized by month, quarter and year. We will have multiple years of data. A lot of the reports we will be creating will be in a comparison manner such as 2009 vs 2008 or Jan this year compared to Jan last year or list out sales by month Jan-Dec 2009. I would like this data to be easily displayed on a report in a side by side manner. To get this result, what is the best way to structure the data in the tables on a monthly, quarterly and yearly basis? Right now weu2019ve got one field in the table called date (which is a string) which is listed like:
Date
2008YTD
2009YTD
2009Jan
2008Jan
Is it best to break out the date information so that on the report side it will be easier to work with? Also should this be set up in the table as a date instead of a string? If so how do you account for a YTD date? Are we going to need 2 dates, a start and end date to achieve ytd or qtd information? Do you recommend creating just a date table and if so how would that be structured?
So for reporting purposes, using crystal reports, I would like to display comparison data on a report side by side, for this example this year goals compared to last years goals by goal code A-Z (which is a credit code, goals are for the # of credits by code for the year). The end result I would like is to look like this:
code 2009 goal 2008 goal
A 25 20
B 50 60
C 10 15
However the data looks like this (displaying all of the 2009 data first then the 2008 data, not side by side which is how it is in the table):
code 2009 goal 2008 goal
A 25
B 50
C 10
.
etc to Z
A 20
B 60
C 15
Right now the data is structured in the table like:
Code Goal Date (this is currently a string in the db)
A 25 YTD 2009
B 50 YTD 2009
etc. A-Z for 2009 then:
A 20 YTD 2008
B 60 YTD 2008
Any thoughts on strucuting a table would be appreciated. thanks.