Best way to set up a custom table using dates ytd, quarters, months

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.

Jennifer,
Most of the DW examples I've seen use a dimDateTime table in the database. That table has multiple columns related to the specific time... For example, here are the columns that are in the, SQL Server sample database, "AdventureWorkdDW"... "DimTime" table
COLUMN_NAME             COLUMN_INFO
TimeKey               (int, not null)
FullDateAlternateKey     (datetime, null)
DayNumberOfWeek          (tinyint, null)
EnglishDayNameOfWeek     (nvarchar(10), null)
SpanishDayNameOfWeek    (nvarchar(10), null)
FrenchDayNameOfWeek     (nvarchar(10), null)
DayNumberOfMonth     (tinyint, null)
DayNumberOfYear          (smallint, null)
WeekNumberOfYear     (tinyint, null)
EnglishMonthName     (nvarchar(10), null)
SpanishMonthName     (nvarchar(10), null)
FrenchMonthName          (nvarchar(10), null)
MonthNumberOfYear     (tinyint, null)
CalendarQuarter          (tinyint, null)
CalendarYear          (char(4), null)
CalendarSemester     (tinyint, null)
FiscalQuarter          tinyint, null)
FiscalYear          (char(4), null)
FiscalSemester          (tinyint, null)
Then all of the fact table receive their date stamps by linking back to this table, using the TimeKey as a foreign key.
HTH,
Jason

Similar Messages

  • Best way to handle single line Customer and Address Data

    Hi, We have customer data in a single line means name, address everything is in a single line. I am now suppose to cleanse this data using Data Quality. Now my question is how to parse this data. Normally I have dealt with multiple line or address data which I can map to input fields of the Address cleanse transforms. In this case, Shall I just map that single field to "Address_line" of the Address cleanse transform? It should be able to parse or shall I parse all the fields using some function in Query transform and then feed into Address Cleanse transform?
    Thanks,

    Hi, We have customer data in a single line means name, address everything is in a single line. I am now suppose to cleanse this data using Data Quality. Now my question is how to parse this data. Normally I have dealt with multiple line or address data which I can map to input fields of the Address cleanse transforms. In this case, Shall I just map that single field to "Address_line" of the Address cleanse transform? It should be able to parse or shall I parse all the fields using some function in Query transform and then feed into Address Cleanse transform?
    Thanks,

  • Best way to set layout of custom component

    Hi
    I'm creating a MultiComboBox component made up of a variable number of combo boxes. It's essentially a way for the user to select from a list, then a sub-selection list (then, if appropriate, a sub-sub-selection list etc) until a final selection is made. A sort of category hierarchy thing.
    Anyway, I've got it working, but it's bothering me that the layout (I'm currently using a grid layout) and the border are currently hard-coded in the constructor of the MultiComboBox. This seems to be the way that most custom components are created, although my MultiComboBox could easily work with a number of different layouts, so I'm thinking there must be a better way that would enable the user of the component to set their own layout and border. Is there an effective standard approach for going about this? I'm thinking I should be overriding a few methods of Component / JComponent / JPanel (which my MultiComboBox currently extends), like the getLayout(), getBorder(), so that they either return my default layout, or a layout the user has set with setLayout(). But then would I need to call validate() or something, and where should I be creating my array of combo boxes (currently I'm doing this in the constructor)?
    Any advice appreciated
    Martin

    Hm ...
    I use JTree for example to organize my application - say it is a kind of alternative menu and organizing system. It is a simple to use and very flexible component if you really have studied, how view, model and controller are working together - each of them can be manipulated or even replaced.
    The whole swing architecture is highly reconfigurable - I like it's design very much even so you have to struggle with it when you start using swing components for the first time :) - a very important point is to understand the event handling of the components - some people don't study that and struggle with invalidate() revalidate() and repaint() what is not needed at all, if you have understood which event to fire from which object :)
    greetings Marsian

  • Best way to set up annual accounts spreadsheet

    I just bought iWork 09.
    What's the best way to set up a spreadsheet in numbers for annual accounts that list weekly totals?
    Would it be best to create a sheet for each week or one sheet with 52 tables?
    I need to summarise all 52 weeks' totals onto one table.
    I also need to date and number (1-52) each week.
    Which leads me to my next question:
    Can you select multiple sheets in numbers like you can in MsExcel? For example, to enter the same formula on multiple sheets in Excel you select them all then change the formula on one sheet.

    My 2-cents.
    Since you need to summarize all the tables, I would place them all in one sheet. Then you can have a summary table with a simple formula that sums all the tables.
    For example, if you wanted to sum cell B2 in all 52 tables, then the formula would be: =SUM(week 1:week52 :: B2)
    If you remove or add tables in between tables "week 1" and "week 52" as ordered in the panel on the left, then the formula updates accordingly. Nifty feature, but too bad it doesn't work if the tables you summarize are on separate sheets.
    I'd also add, from my own experience with spreadsheets, keep backups and you might avoid keeping multiple years in one document if you don't have a need to do it that way.
    Quickpost this image to Myspace, Digg, Facebook, and others!
    Message was edited by: scott_e

  • What is the best way to set up iTunes on our home network so all family members have access to all of our itunes library, even music we don't have on the cloud?

    I have five different people using 10 different apple devices on one itunes account in our family.  We have had trouble sharing.  What is the best way to set up itunes on our home network?  We have purchased music that sits on icloud, but we also have music we have imported from our previous cd library.  Our itunes program keeps crashing and dumping everyone's playlists.  So far we have all been using just the one desktop computer to sync to because we can't figure out how to share the same librarly and playlists on multiple computers in our home so devices can be synced at any location as well as playlists and purchases be made. 

    What is the best way to set up itunes on our home network? 
    One iTunes library per person.  One iTunes account per person.
    If people wish to share songs, they can make copies.
    When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated!

  • What Is The Best Way To Set Up Kids iTouch To My iTunes?

    I have an iTouch set up with my iTunes music, movies and apps, but now I gave my kids each an iTouch.
    What is the best way to set up there account, should it be a unique account for each of them or should I put them under my account?
    They will be using my same iMac when they sync or update there iTouch, so will they need to log in under their name every time?
    Not sure what is the best way to set this up, they are both minors, i.e. no credit card.
    Thanks

    Better just your account for multiple devices. The only drawback is that the music will have to managed manually.
    Connect one of the iPods to your computer then launch iTunes. You should see the iPod under Devices on the left side of the iTunes window. Double click then you can name each iPod to keep them separate but only syncs to your iTunes account.
    Without knowing your Apple ID user name and password they would not be able to make purchases ergo no downloads you aren't aware of.
    How to use multiple iPods, iPads, or iPhones with one computer
    The kids are minors.. if they are under 13 years of age, according to Apple, they can't have their own accounts regardless.
    http://www.apple.com/legal/itunes/us/terms.html#GIFTS

  • What is the best way of setting up Family Sharing?

    I just bought my son an iPad Mini and I am trying to decide on what is the best way of setting it up for him. The one thing I do know is that I do NOT want all the content that is my iPhone 6 to pop up on his iPad Mini. I want his iPad to be used for his games and educational stuff and his own music. I don't mind setting up a family photo album and share photos with the family. So is the Family Sharing option the best way of doing this based on what I just mentioned? Do I set him up with his own Apple ID? If so will everything still be based off my account so he won't have to create his own iTunes Library?
    I always use iTunes gift cards to purchase music and content. Will I be able to continue to use them even if I want to put some new content on his iPad and not my iPhone? Do I enter in his Apple ID info. Can you restrict certain family members to just certain things for example you only want to share photos with one person whereas you might want to share your music with another family member?
    Any suggestions on the best way of setting this up would great!
    Thanks!

    Hi DVX100Shooter,
    Congratulations on getting your son a new iPad, I am sure he will enjoy it. 
    Family Sharing is one way of managing both purchases and content between members of a related group of people. Each member must have their own Apple ID. You can choose what music you wish to share with the family from your own account. See this article -
    OS X Yosemite: Share purchases with your family
    In particular the section titled Hide a purchase from other family members
    The music library on your son's iPad is separate from yours, but under Family Sharing you agree to pay for all purchases made through the iTunes store. If you wish to control what is purchased you can set up the Ask to Buy option for any family member under adult age in your location. See this article for details -
    Request and make purchases with Ask to Buy - Apple Support
    Gift cards may not be used for billing of purchases under family sharing, with the exception that a family member may use gift cards to purchase their own content. See this article for information about Family Sharing billing policies -
    Family purchases and payments - Apple Support
    The shared family photo album is available to all family members.
    Family Sharing - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • Our granddaughter has a ipod. She's getting a iphone and a mini idpad.  what is the best way to set them up. Does she need a new apple id and password or would she use the same one she has for her ipod

    our granddaughter has a ipod. She's getting a iphone and a mini idpad.  what is the best way to set them up. Does she need a new apple id and password or would she use the same one she has for her ipod

    Just use the same one on all devices.

  • What is the best way to set up iTunes to deal with a massive media library?

    I have a really big media library...probably 7k-10k digital photos, close to 1,000 ripped CDs, and over 600 ripped DVDs, all stored on 1.5TB external hard disks in a 4-drive enclosure.
    Due to a recent technical glitch, I find myself installing a new drive and moving the current library. My question is, what is the best way to set up iTunes' settings to deal with a media library that is both external to the Mac on which it runs, and spans multiple physical hard disk units?
    I generally like the idea of iTunes organizing my library for me (i.e. keeping everything in Media Type>Artist>Album folders via the "Automatically Add to iTunes" folder), but I'm not sure how that's going to work spanning multiple drives.
    I just figure since I'm basically starting over with my iTunes installation, maybe there's a better way to do it.
    Thanks in advance for any advice you can offer.

    You can set them up as a software RAID using Disk Utility.
    It'll simply be one large disk for all intents and purposes.

  • What's the best way to set up new imac for logic etc?

    In brief:
    Getting new imac (27", 3.4 i7, 8-16GB ram, 1TB HD). Will be using it mainly to run Logic Studio (loads of plugins) and Final Cut Express. I also have 2 external Hard drives one 500G one 1TB.
    The last imac I bought was my first and just went ahead and threw everything at it not really knowing where things should go. This time I want to set things up correctly.
    Basically, with what I've got, what is the best way to set things up. I.e where do I put logic files, samples, BFD2, Amplitube etc. Where do I put videos for use in FCE. Storing projects and backups for use with Time Machine.
    Also noticed the new imac will only have 1 firewire port. I will need to plug in the Hard drives (daisy chained), camera and RME Fireface 800. Was thinking of getting a Thunderbolt Hard drive but they are expensive and hard to find.
    Would really appreciate any help before I get the new machine and start messing things up again.
    Thanks.

    Adding to babowa, enable the system firewall in System Preferences>Security>Firewall tab. Click Advanced and check Stealth Mode.
    Lion is a pretty steady and secure operating system, and as there really aren't MANY Mac viruses, there ARE viruses out there still. OS X is pretty good about letting you know if you do accidently download a virus, and it will help you throw it away if it detects one, such as the MACDefender virus. OS X has built in security features such as sandboxing that doesn't allow viruses in as easily as a Windows PC. As for hackers, as long as you have the firewall enabled and a secure password (for your computer and email accounts), then you should be fine.
    It's the user that lets the virus in, not the computer (unless there's some untold serious vulnerability in OS X, which is highly unlikely). Keep your apps up to date, don't download pirated software, and be street smart on the internet. Don't download things or visit websites that you don't think are real. Safari includes a Phishing feature that automatically detects known phishing sites, protecting you from that big problem. Keep your passwords secure and you should be fine.
    There are antivirus solutions out there, one notable one available in the AppStore is Intego's VirusBarrier (free and plus versions), if you feel you still need one.
    I wouldn't worry about it. Windows users who switch to Mac are always asking these questions.
    Here's some good reading as well
    http://www.apple.com/macosx/what-is/security.html
    Enjoy OS X Lion

  • What is the best way to set up multiple Apple devices ?

    Lime many of us here I have quite a few apple devices and I just wondered whet the best way to set them up with itunes / Apple
    my Apple gear:
    Mac mini 2.53 with Mountain Lion
    Mac Mini 1.6 duo Snow Leopard
    Iphone 5c (mine) running 8
    Iphone 5c (wifes) running 8
    iPad 2 (old)  64 GB  running 8
    iPad Mini 2 retina  32 GB running 7
    g3 iMac (running Tiger) Juke box (semi retired ;-) now)
    At the moment all devices (apart from new Mac mini 2 and the old G3) are set up under my Apple ID ... (1 Apple ID for all devices) ... obviously this has problems : my wife downloads an App it will appear on my phone; we have had to disable some of the messaging systems as at one point my wife was getting my messages et ... is there a better way to do this? 

    cosmiconion wrote:
    one drawback of same Apple ID for store is that what she downloads will automatically appear on all devices
    Do you mean the visibility of the purchase in the App Store (under purchases) or the installation of the app automatically on the other devices?
    In the App Store on the device (under iOS 8 at least on the iPad, I couldn't get it to work on my iPhone 5 under iOS 8), you can hide purchases...just swipe it to the left in the Purchased list. You can then unhide the hidden purchase(s) if desired by using iTunes on the PC/Mac under your iTunes account.
    Auto App updates (Automatic Downloads) can be controlled under: Settings/iTunes & App Store, scroll down to Automatic Downloads and disable those that you do not want.

  • TS3367 I own iPad mini and iPhone 4. I'd like to use FaceTime to talk to my partner whilst I'm in hospital. What's the best way of setting it up. Can I use my apple username for both devices?

    So have iPad mini and iPhone. But I'd like to leave my iPad with my partner whilst I'm in hospital so we can FaceTime each other.
    What's the best way of setting this up!

    http://support.apple.com/kb/HT4319

  • HT2534 I have two class sets of iPad 2s and I would like to set up an iTunes account but don't want to put in my credit card information or individual students' information. What is the best way to set up class sets of iPads?

    I am a K-6 tech teacher and just recieved two classroom sets of iPads. I'm wondering what is the best way to set up iTunes so that apps may be downloaded. I do not want to put my personal information in and I do not want students to put in their informtion either. Teachers want to be able to download free apps and when the school purchases iTunes gift cards, they would like to be able to use them. What is the best way to go about this?
    Thank You!
    Jess

    Contact your IT person. They will help you with provisioning & setting up the iPads and getting apps on them and locking them down so students can only access certain settings and apps.
    I have asked that this post get moved to iPad Enterprise as it is more approriate forum for your question (even though it is about schools))
    Don't create an AppleID yourself and use it to put stuff onto the school iPads. You can't have more than 10 iPads to one iTunes account anyway.

  • Best way to set up iPad mini for child?

    So I bought my 3yr old an iPad Mini since he already knows how to fully operate most things on my iPhone! Now when I go to set it up, I don't want my music and apps and other content popping up on his iPad. Now can I create an Apple ID for him but set it up to where I can still have control over it? The guy in the store suggested I set it up using iCloud Family Sharing. When I got home and looked more into the family sharing option, I am not sure that is what I want either. That sounds like everybody in your family would have access to everything on the main device correct or am I wrong?
    So this is what I want. I want to be the one who can purchase apps or download free apps by typing in his Apple ID info (if possible). I want him to have his own favorite songs via iTunes. The only thing I would want to share is probably a Family photo album in iCloud.
    So what is the best way of setting this device up?
    Before he mentioned the iCloud Family Sharing option, the guy in the store suggested I leave the iCloud info blank when it asked for it but set up the iPad Mini as if it was my device. I think that just confused me even more.
    If I chose the Family Sharing option, can I select exactly what gets shared or no? If yes? Can apps be shared?
    Lastly if I set him up with his own Apple ID, and he wants a new song or some music or download a movie etc. will he need his own iTunes Library?
    Thanks for your help!

    I think that, if you read through these forums and familiarize yourself with the number of problems allowing children the ability to exercise and maintain control of an iDevice, and to purchase and download content, you'll change your mind.

  • Best way to set up partitions on 250GB external drive

    Hi all,
    I've decided to go with an Iomega eGo 250-GB FireWire portable drive to back up my iBook's hard disk (30 GB) plus to store my photos and maybe hold a bootable copy of OS9.
    This is my first time using an external drive, so I don't really know how to go about setting things up.
    What would be the best way to set up the partitions on the external drive?
    1) I know I should create a 30GB partition for the iBook backup, but what about for the remaining volume? Is it best to leave it as a single large 200GB partition, or split it into two 100GB chunks? Other than the clone of my iBook, I'll mainly be storing photos (at the moment no more than around 10-12GB).
    2) I don't yet have a huge iTunes collection, but if I later want to store iTunes music that doesn't fit on my internal drive, is it fine to put it in the same partition as the photos, or would it be preferable to create a separate partition?
    3) If I want to install OS9 on the drive, how much space should I allot to it? Would this enable me to run legacy apps on my iBook?
    4) Does it matter how I name the partitions (i.e. should the name for my iBook back-up be the same as the original volume or should it be different?)
    5) As I still don't know exactly what I need, If today I decide to create only 30GB partition to backup the iBook, can I later partition the remaining space without having to start all over again?
    6) Also, the drive came out of the box with Mac OS Extended format. Is this the best format or is there another that would be better?
    Thanks for any advice
    Message was edited by: Lutetia

    1) I know I should create a 30GB partition for the iBook backup, but what about for the remaining volume? Is it best to leave it as a single large 200GB partition, or split it into two 100GB chunks? Other than the clone of my iBook, I'll mainly be storing photos (at the moment no more than around 10-12GB).
    2) I don't yet have a huge iTunes collection, but if I later want to store iTunes music that doesn't fit on my internal drive, is it fine to put it in the same partition as the photos, or would it be preferable to create a separate partition?
    The answer to both question is that it's completely up to you. Partitioning or not partitioning won't affect operation significantly.
    3) If I want to install OS9 on the drive, how much space should I allot to it? Would this enable me to run legacy apps on my iBook?
    The iBook G4 can not boot from OS 9 so you would only be able to run OS 9 in the "classic" environment.
    4) Does it matter how I name the partitions (i.e. should the name for my iBook back-up be the same as the original volume or should it be different?)
    No
    5) As I still don't know exactly what I need, If today I decide to create only 30GB partition to backup the iBook, can I later partition the remaining space without having to start all over again?
    There are a few tools which promise the ability to change the partitioning without destroying the data on the drive. But you should never do this without making a backup of the data on the drive. Data loss can easily happen and in a big way.
    6) Also, the drive came out of the box with Mac OS Extended format. Is this the best format or is there another that would be better?
    That is the best format.

Maybe you are looking for

  • Flash player crashes my computer when used . . . please help!

    the newest versions of flash player required for use in you tube and hulu crash my computer and causes it to reboot. I'm using windows xp home edition 32 bit, have updated my drivers, and have tried to use several different versions of the flash play

  • Analytic functions in expression

    Hi list, is there a way of using an analytic function in an OWB expression? Just like with DECODE it doesn't seem possible, because OWB creates something like x := analytic_function(), I think for tracing or error handling purposes. If I want to have

  • SQLLDR direct path allows duplicates in primary key

    I would like to use sqlldr direct path to load millions of records in the table but direct path allows duplicates on the primary key constraints. inserts duplicates sqlldr deploy_ctl/deploy_ctl@dba01mdm control=ctl_test.ctl direct=true primary key is

  • How to populate User defined Error message

    Hi i have a requirement as follows, we have 2 types users(patient and doctor) some fields are mandatory for doctor and some of them for patient creation. when they miss some fields while creating doctor it has to throw error message saying " these fi

  • Counter field in database table

    Am just thinking about how to solve a little problem which is new to me in PHP, but I'm hoping not to complex. Basically, I have a database of holiday resorts, and my client would like to keep track of how many people click through to the resorts own