Skip to Content
author's profile photo Former Member
Former Member

Quarter Calculation in Transformation based on Billing Date


I need Quarter to be calculated based on the Billing date. I created a Z Characteristic & added it to my DSO, mapped Billing date (FKDAT) to this Z characteristic in Transformation. Then, I created a Formula in this mapping: Calculate Quarter from Day - DATE_QUARTER( FKDAT). When i load data, the Output i get is in the Format 20112 whereas i need in the Format 2011 Q2 or Q2 2011. I checked for a Standard formula for this but couldnt find anything.

Please let me know if there is any standard formula or routine to achieve this in Transformation.

I have also searched for this scenario in this Forum but didnt find anything useful.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Nov 09, 2011 at 08:52 AM


    There is no such standard formula/ routine available to meet your requirement.

    You will need to write a custom routine in transformation to meet your requirements.



    Add a comment
    10|10000 characters needed characters exceeded

    • You can write a code transformation routine as:

      data: month      type  c LENGTH 2,
        month  =source_fields-billing_date  +4(2).
        case st_mon.
          when 1 or 2 or 3.
            result = 'Q1'.
          when 4 or 5 or 6.
            result = 'Q2'.
          when 7 or 8 or 9.
            result = 'Q3'.
          when 10 or 11 or 12.
            result = 'Q4'.



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.