cancel
Showing results for 
Search instead for 
Did you mean: 

Macro to find day

Former Member
0 Kudos

Hi

I have a requirement like i need to find the no of days in a week and in that days i need to find thursday.

I see there is macro function to find no of days i,e BUCKET_WDAY(), also there is macro function WEEK() which returns nos 1 to 7 where 1= monday etc.

can any one help me on how to build up the logic.

your immediate response is highly appreciable.

Regards

Vijaya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

WEEKDAY() will return values like Monday =1 , Tuesday =2 , Wednesday =3 ,Thursday = 4 and Friday= 5

need to keep ROW : Stock on Hand ( column attributes ) and RESULT condition should used in the single  iteration ( if you are using RESULT = 5 that mean checking for Friday )

Former Member
0 Kudos

Hi vijaya,

You can use Bucket_WDAYS as below for finding the number of workdays in the week.

BUCKET_WDAYS( CALENDAR( ACT_LOCATION ; 'SD' ; ACT_VERSION ); Row: DRP/COBRA Net Demand "FA" ( Frm 03.02.2010 ) ). The data source for the choosen row e.g. DRP/Cobra here should be column attributes.

This is available in standard planning book SNP94(1)_Batch processing also as determine workdays macro.

Regarding your query for finding Thrusday, can you tell me if you are looking for finding the date as an output within the weekly horizon on which thurday lies ?

Regards

Gaurav

Former Member
0 Kudos

Hi Gaurav,

Thanks for your quick respone.

I need to find if thursday is there in that weekdays.

i want to build up a logic like

for example:

using BUCKET_WDAY() i will find no of days in that week.

calculation: Q = no of days x P i,e Q = BUCKET_WDAY() x P

Now i should write a condition that if WEEKDAY( each day) in that week days[which we have arrived from above using BUCKET_WDAY() ] is = 4(i,e thursday)

then calculation: X = Y

Please let me know if you need some more input.

Regards

Vijaya