Skip to Content
author's profile photo Former Member
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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.