Former Member

# 0CALQUARTER populating wrongly for August

Dear experts,

I applied the below logic, in the expert routine, to get 0CALQUARTER from 0CALDAY and it is working fine for any day in April and July months. However, for any day in the month of August, wrong value is populated(as 20134).

For April 0CALQUARTER displays 20132

For July 0CALQUARTER displays 20133

whereas, for August 0CALQUARTER displays 20134 as opposed to 20133.

a = ( ( Source_pkg-calday+4(2) ) / 3 ) + 1 . " Quarter

b = ( Source_pkg-calday+0(4) ). " Year

If a <> 0

OR a <= 0.

concatenate b a into result_pkg-CALQUARTER.

ENDIF.

10|10000 characters needed characters exceeded

### Related questions

Posted on Aug 29, 2013 at 10:31 AM

HI,

You can simply use a standard transformation formula to convert calday to quarter. No expert routine is required.

DATE_QUARTER

Regards,

Suman

10|10000 characters needed characters exceeded
• Suman Chakravarthy K Former Member

Although you may not be able to remove the expert routine. My suggestion is to avoid expert routine. Because, you cannot create any transformation rules between source and target when you use expert routine. This is a draw back.

Why don't you simply use the formula which i suggested? Your Aug problem also will be resolved. It is a standard formula which will work perfectly in any case.

• Posted on Aug 29, 2013 at 04:00 PM

Hi

How is the variable a defined? make sure it say a type I.

If its a float or anything else 3.66 will turn to 4

that should solve it

Martin