Link to home
Start Free TrialLog in
Avatar of Namik48075
Namik48075

asked on

Calculated Date Field in Dw

How can I do the calculated date  in the dw with Computed  field.
I have a Computed Field where I calculate the number of months the item expire in.
Now, based on that I need to report the month when the part expire.


Ex.
Remaining Hours 400
Remaining Months 400/180 ( 180 часов в месяц хардкодед)= 2
Expire Months 2

Expire Date needed Todays date + 2 months = August, 2006...

How to do the calculations for the date.
In SQL I could do the Dateadd, but how do I do that in Dw.

thanks

Avatar of Lordain
Lordain

Look at the RelativeDate Function.
Avatar of Namik48075

ASKER

Thank you,

Is the relative date only works with days, is it possible something like thins for months?
ASKER CERTIFIED SOLUTION
Avatar of Lordain
Lordain

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can try this

 If((400/180)+2>12,13 - (400/180)+2, (400/180)+2) make a compute filed with the name c_month
The creat another computete file like this

If(c_month=1,’Jan’,if(c_month=2,’Feb’, if(c_month=3,’March’, if(c_month=4,’April’, if(c_month=5,’May’, if(c_month=6,’june’, if(c_month=7,’July’, if(c_month=8,’August’, if(c_month=9,’Sep’, if(c_month=10,’OCT’, if(c_month=11,’Nov’, if(c_month=12,’DEC’,))))))))))))
sorry for mistyping

you can try this

 If((400/180)+2>12,13 - (400/180)+2, (400/180)+2) make a compute filed with the name c_month and hide it
Then creat another computed filed like this

If(c_month=1,’Jan’,if(c_month=2,’Feb’, if(c_month=3,’March’, if(c_month=4,’April’, if(c_month=5,’May’, if(c_month=6,’june’, if(c_month=7,’July’, if(c_month=8,’August’, if(c_month=9,’Sep’, if(c_month=10,’OCT’, if(c_month=11,’Nov’, if(c_month=12,’DEC’,))))))))))))