on 08-24-2011 8:07 PM
Hi all,
I have to create a macro at week level so that sales history of 1 and 2 years back can be viewed. The problem is with the years which have 53 weeks in them. e.g. 2009 which are creating an offset while copying from last 2 years. Can anybody help me the logic with? I would appreciate the help.
Thanks.
Hello,
Not qutie sure about your logic ... are you trying to copy a 53 weeks sales hisitory to a 52 weeks' period?
I think this depends on your request ... In this case, where do you want to put the 53rd history?
Maybe you can use macro function YEAR() to make a judgement ...
What is your macro looks like now? More detailed information is appreciated.
Thanks.
Best Regards,
Ada
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ada,
thanks a ton for the reply. I want to copy previous years sales history. If previous year has 53 weeks/buckets then it creates problem. from 1 to 52 it copies correctly but the extra 53rd week in previous year gets copied into 1st week of next year. e.g. 53rd week of 2009 gets copied into 1st week of 2011which is not correct. I want to skip 53rd week somehow. so that after 52nd week of 2009 it jumps to 1st week of 2010. I would appreciate the help.
Hello,
I think you can use macro function WEEK().
If the return value is 53, you can do something special to it.
WEEK( X ) returns the week in a date X that is expressed in whole numbers with reference to the date 0001/01/01. Example: WEEK( DATE( 20001220)) = 51. The argument can either be a number you enter in an Operator/Function dialog box or one of the macro elements cell, row, or column from the planning table or auxiliary table.
Best Regards,
Ada
2 years back 2 cell time forward
copy from 2 years back : ( 157 Iterations : W 35/2009; W 34/2012 )
New action box
VEC_LAYOUTVARIABLE_SET( 'vector' ;
WEEK( BUCKET_BDATE(
Row: Historical Billing Qty. ( Frm W 35/2009 )
)))
Row: time move backward ( Frm W 35/2009 ) =
VEC_LAYOUTVARIABLE( 'vector' )
Row: Historical Billing Qty. 2 Yr. ( Frm W 35/2011 ) =
Row: Historical Billing Qty. ( Frm W 35/2009 )
IF
check for 53 for 2 years back row
WEEK( BUCKET_BDATE(
Row: Historical Billing Qty. 2 Yr. ( Frm W 35/2009 )
) )
>= 53
Row: time move backward ( Frm W 35/2009 ) =
1
Row: Historical Billing Qty. 2 Yr. ( Frm W 35/2009 ) =
TIMESHIFT_BACKWARDS(
Area: [ $Historical Billing Qty. 2 Yr. ( W 35/2009 ) ; $Historical Billing Qty. 2 Yr. ( W 34/2012
Row: Historical Billing Qty. 2 Yr. ( Frm W 35/2009 )
Area: [ $time move backward ( W 35/2009 ) ; $time move backward ( W 34/2012 ) ]
Row: time move backward ( Frm W 35/2009 )
)
ENDIF
IF
check for 53 for Hist Bill row
WEEK( BUCKET_BDATE(
Row: Historical Billing Qty. ( Frm W 35/2009 )
) )
>= 53
Row: time move forward ( Frm W 35/2009 ) =
0
Area: Historical Billing Qty. 2 Yr. ( W 35/2009 ) =
TIMESHIFT_FORWARDS(
Area: [ $Historical Billing Qty. 2 Yr. ( W 35/2009 ) ; $Historical Billing Qty. 2 Yr. ( W 34/2012
)
ENDIF
User | Count |
---|---|
9 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.