Page 1 of 1

date function in parallel Job

Posted: Wed Jul 06, 2005 8:20 am
by anupam
Hi,

I need some advice on date function in parallel extender. I want to have data for only the current quater from dataset.

My job would be

Full_Data_dataset ---> transformer/Filter_thisQuaterData ----> ThisQuaterData

Please let me know what is the solution.

I can do it using server routine but then unable to call the server routine from the Parallel Job.

Posted: Wed Jul 06, 2005 8:23 am
by ArndW
anupam,

if performance is not an issue, you can always use a BASIC transform stage in a parallel job and enjoy all the benefits of the ICONV/OCONV functions for date conversions.

You can use the builtin date conversions in Px such as DateToString to perform your cast to the new data column. Another way would be to keep the datatype until you do your database write and use to_char() in the SQL.

Posted: Wed Jul 06, 2005 9:42 am
by elavenil
MonthFromDate(<date in the full data set>) would give you month number and quarter can be derived based on the month number and you should have current quarter in a parameter. So current quarter can be filtered in the filter stage.

I have no idea whether this is better way of getting the quarter in PX.

HTWH.

Regards
Saravanan

Posted: Wed Jul 06, 2005 9:48 am
by anupam
Hi,

The way to find out the 1st date of this quater is not a problem

Oconv(QUARTER.FIRST(Oconv(date(), "D4Y"):"Q":Oconv(date(), "DQ")) ,"D-YMD[4,2,2]")

But the problem now is when using this code in server job it is absolutly working fine. But when i use this piece of code in Parallel Jobs then i am getting null in this particular column as an output.

Any Suggestions...

Posted: Wed Jul 06, 2005 9:52 am
by ArndW
anupam,

have you use a BASIC transformer stage and not a normal transformer stage in the Px job?