on 01-13-2015 8:02 AM
Hi Guru,
I have 5 Weekly moving Average report with 2013 ,2014 data.
user will enter the week based on that week we need -4-3-2-1 like 5 and also we are calculating average.
but only we are getting which ever the selection i used.
ex : 24.2013 if i select then it display 24,23,22,21,20 of that 2013 year week only
but our requirement is to display both the year how it is achieve please help me out.
Regards
Praveen.
Sorry Praveen,
I was on vocation so i could not get a time to login. Did you get the solution or u want me to send you the required abap code.
Regards,
Santu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Refer to my previous comment, it will work.
Regards,
Santu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
I assume tht you have the CALDAY in you Cube/MP/Query.
Create a Var on Calyday and u wll get 14.01.2015.
Make this Date as 14.01..2014
Pass this date to FM DATE_GET_WEEK and this will give you 201403 (Current Week).
Do Offset for 201403 with -5 with Range...
I hope this gives an idea.
rgds
SVU
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
I did not get your requirement Can you tell us brief with an example...
Regards,
Santu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
i have 2 year of data 2013, 2014.
i want to do a report 5 weeks moving avarage report..
So i took 0calweek as a user entry, Based on the user gives the values ex 30.2014.
it as to display 30.2014, 29.2014,28.2014.27.2014,26.2014 and also as the same way previous year 30.2013,29.2013,28.2013.27.2013,26.2013 it as to display.
for that i have used offset for current week-1 -2 -3 -4. current week.
regards
Praveen.
Hi Praveen,
Use CMOD code.
If user enters 30.2014 then
lv_var1 = 0calweek+0(4)--will give you calyear(2013)
lv_var2 = 0calweek+4(2)--will give you entered week(30)
then concatinate lv_var1 and lv_var2 to one more variable(ex: cmod_var) value=30.2013
then use offset on this variable(cmod_var)
it will give you 30.2013,29.2013,28.2013.27.2013,26.2013 30.2013,
for 2014 directly apply offset on input varable.
Regards,
Santu
Dear Praveen,
I think the requirement is to get average for 5 weeks of both 2013 and 2014 combined.
Hope you have both Cal week and year in your data target. You can create two selection at the query one for 2013 and one for 2014. Add these to selection in a formula and divide them with 10.
Regards
Gajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Praveen,
Do you calweek and calendar year in your data target.
If yes,
you should have 2 input variables, one for week and one for year.
Now create 2 selection one for current year with week interval with offset to 5 weeks.
The next selection will be for previous year (current year -1) with week interval with offset to 5 weeks.
The above will give you 5 week wise data for 2013 and 2014.
Have I understood you correctly?
Regards
Gajesh
Hi Nagesh,
Please find the original requirement which am doing.
am sending the screen shorts..
for week .
for current week-1
for current week -2
for current week-3
for current week -4.
here am selecting 05 2014.
and the out put is..this.
here am not getting the values of 2013, because am used current one what about the previous year to get values . please help me out.
Hello Praveen
You need not do the individual week calculation like that.
1) For current year use value ranges between and input the ZWEEK variable ( in both from and to) and offset it by -5. It will look like this
ZWEEK-5 - ZWEEK
2) For the previous year , put the value ranges as shown below using offset
ZWEEK-17-ZWEEK-12
you will get both current year and previous year value
Regards
Gajesh
Hi Nagesh,
Thanks for Replay, i have done according you said that is working fine, now Am getting values.
but my requirement is what ever user input value enter ex: 05.2014 if he enter this value
then i need to show 05.2014 05.2013 both the years.
04.2014 04.2013
03.2014 03.2013
02.2014 03.2013
02.2014 03.2013
like this i need to display the out put and provide the average.
Hello Praveen,
I tried the same settings, its not possible to bring in the same format which you mentioned above. As the calendar week has the year part with it, for the same week the data will repeat in 2 different lines if you Cal week in the rows.
Another approach is to make sure that you have a characteristic in your cube which stores only the week part( imean for 01.2014 it stores only 01). you can use this to plot this for your reporting
Regards
Gajesh
DATA: LV_YEAR TYPE /BI0/OIFISCYEAR.
DATA: LV_WEEK TYPE /BI0/OICALWEEK.
DATA: LV_ZWEEK TYPE /BI0/OIFISCYEAR.
DATA: LV_YEAR TYPE /BI0/OIFISCYEAR.
DATA: LV_PYEAR TYPE /BI0/OIFISCYEAR.
DATA: LS_VAR_RANGE TYPE RRRANGEEXIT.
DATA: LS_OUT_RANGE TYPE RRRANGESID.
DATA: LV_WEEK TYPE /BI0/OICALMONTH2.
WHEN 'variable name'. ( new variable )
IF I_Step = 2.
READ TABLE I_T_VAR_RANGE INTO LS_VAR_RANGE
WITH KEY VNAM = 'ZWEEK'.
IF SY-SUBRC = 0.
LV_YEAR = LS_VAR_RANGE-LOW+0(4).
LV_WEEK = LS_VAR_RANGE-LOW+4(2).
LV_PYEAR = LV_YEAR-1.
CONCATENATE LV_PYEAR LV_WEEK INTO LV_ZWEEK.
LS_OUT_RANGE-LOW = LV_ZWEEK.
LS_OUT_RANGE-SIGN = 'I'.
LS_OUT_RANGE-OPT = 'EQ'.
APPEND LS_OUT_RANGE TO LT_OUT_RANGE.
E_T_RANGE = LT_OUT_RANGE.
ENDIF.
Regards
Gajesh
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.