Skip to Content
0

How to calculate last 6 months sales in sap bods?

Jan 26, 2017 at 09:56 AM

138

avatar image

Hi

How to calculate last 6 months sales from current date.

Thanks,

sekhar

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Arun Sasi Jan 27, 2017 at 10:54 AM
1

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


lasop.png (12.7 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Arun,

Thanks for response.

Sorry for delay, I tried above process,but I didn't get result.

thanks,

sekhar

0

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

0
srinivas panala Jan 31, 2017 at 01:27 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Chandra Sekhar K Jan 31, 2017 at 02:33 PM
0

Both methods are working

Thank you Arun Sasi and Srinivas Panala

Share
10 |10000 characters needed characters left characters exceeded