LAST DATE OF A MONTH

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mcs@rajesh
Participant
Posts: 46
Joined: Mon Sep 24, 2007 12:37 am
Location: INDIA

LAST DATE OF A MONTH

Post by mcs@rajesh »

HI

Month_date is the one of the column in my source which contains only the name of the month for ex"January"."March"....
I need to get the last date of these months
for ex "January"="2008-01-31" likewise i need to calculate the last date for all the mont in the similar fashion.
Guide me if this can be achieved in DS.

Thank you
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

TIME dimension works great (really the TIME subject area). A DATE grain table, a MONTH grain table, a QUARTER grain table, and a YEAR grain. You can reverse lookup on month name and year to the MONTH table. Your month table would have many attributes describing the month, which probably should include the last day in the month as a date.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

or, find the first day of the next month and subtract 1.

(And as Ken mentions, this would be good meta data to have in your Date/Time dimension, since you don't want each developer coming up with his/her own way of deriving it, if possible)
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

LastDayCurrentMonth, FirstDayNextMonth, ThisDayNextMonth, LastDayLastMonth, FirstDayLastMonth, ThisDayLastMonth are all good columns to have in a time dimension table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply