cancel
Showing results for 
Search instead for 
Did you mean: 

Macro function to calculate the no of days till to date in the planning book.

yadagiri
Participant
0 Kudos

Dear Experts:

We create forecast in monthly buckets. Our requirement is to calculate the no of days till to date in the current bucket and to get the forecast til to day in the bucket and compare it to actual sales and generate a alert,

I am facing the issue in getting no of days till today in current bucket.

The  function WDAYS() get the total no of days in current month and not abel to get the no of days till today in current monthly bucket.

Please let me know how to get the no of days till today in current bucket.

Thanks in advance.

Warm Regards

Yadagiri

Accepted Solutions (1)

Accepted Solutions (1)

ruchi_das2
Active Participant
0 Kudos

Hi Yadgiri,

Have you tried the date functions BUCKET_BDATE() and Today? More information on date functions can be found at Date Functions - Operators and Functions in Macros - SAP Library


If you are using monthly buckets, BUCKET_BDATE() can be used to return the start date of the month and BUCKET_BDATE(Today) gives you today's date. You can calculate the difference and have the no. of days from start of bucket to current day.


Regards

AK

emani_raghavendra
Participant
0 Kudos

Can you check day() function ?

Answers (1)

Answers (1)

former_member187488
Active Contributor
0 Kudos

Hi,
Please try CALENDAR_WDAYS() function.
For the first parameter you specify a time stream calendar (if no calendar is necessary just make it blank).
For the second parameter you specify the date of current bucket (BUCKET_BDATE or BUCKET_EDATE).
For the third parameter you specify the date of today (TODAY).

BR, Ada