Skip to Content

How to calculate last 6 months sales in sap bods?

Hi

How to calculate last 6 months sales from current date.

Thanks,

sekhar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 27, 2017 at 10:54 AM

    You should be able to achieve this using Script

    Get the value in a Global variable

    $G_Last_6_Months = sql('DS_NAME', select sysdate as TODAY, ADD_MONTHS(TRUNC( TO_DATE(max(sysdate),'DD-MON-YY'), 'MON' ),-6) FROM dual');

    and then play around with this date

    Regards

    Arun Sasi

    Add comment
    10|10000 characters needed characters exceeded

    • Thats impossible...

      It should work. btw I just gave an example using the dual table. You need to replace the dual table by your table(table_name)

      It also depends on the database which you are using. I have used Oracle sql

      Regards

      Arun Sasi

  • Jan 31, 2017 at 01:27 PM

    Hi,

    You can just simply assign the below code to a variable.

    $Last = add_months(sysdate(), -6);

    Then use the variable as per your flow.

    Thanks,

    Srinivas.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 31, 2017 at 02:33 PM

    Both methods are working

    Thank you Arun Sasi and Srinivas Panala

    Add comment
    10|10000 characters needed characters exceeded