Hi
There are many options available to this requirement....
What is the starting month of the year for your client? is it Jan or Apr?
Do you have 0CALMONTH2 or 0FISCPER3 in your cube? This is crtical for this approach..
Assume you have 0CALMONTH2 and 0CALYEAR and year starts with Jan of every year..
1) T get revenues by monthly..
Create 12 RKF for each period starting Jan to December based on 0CALMONTH2 or 0FISCPER3..
Say for JAN, you have create one RKF from revenue with restriction on 0CALMONTH2 = 01 and 0CALYEAR as curent year from SAP exit variable 0CURYEAR..
Similarly create 12 RKF....
2) To get YTD revenue..
Create YTD RKF by restricting revenue JUST only with 0CALYEAR = SAP Customer exit variable 0CURYEAR
3) Create previous year revenues by "OFFSET" function on RKF....
If your year starts on April, then do following.
Assuming you have 0CALYEAR is poluating from 0CALMONTH..say for Jan-2104, 0CALYEAR has 2014, not 2013...
First Create customer exit variable [ say Z_YEAR] on year 0CALYEAR and populate it with your actual year, not current system year...This should be done in I_STEP2 based on system date 'SY-DATUM' like following
IF sydatum+4(2) LE 3.
z_Year = sy_datum(4) - 1 .
ELSE.
z_year = sy_datum(4).
ENDIF.
Say if it's Feb-2014, then actually for you it's 2013..not 2014... but if it's May-2014, then it's 2014.. You can search "How to implement customer exit variable" if you need further details...
1) To get monthly revenue data
Create RKF for Apr by restricting revenue on 0CALMONTH2 as 04 and 0CALYEAR as Z_YEAR.
Key Figures = Revenue
0CALMONTH2 = 04 [for April month, fixed value]
0CALYEAR = Z_YEAR [customer exit variable]
Similar way create for May to Dec periods...now you have 9 RKF.
For Jan, create RKF by restricting 0CALMONTH2 as 01 and 0CALYEAR as Z_YEAR + 1 [offset increase by 1].
Same way for Feb and March.
Now you have 12 RKF each one for each period..
2) To get YTD [starting April] - create CKF by simply assing above 12 RKF.
3) To get 2012-2013 data [previous year]
Create first RKF by restricting revenue by 0CALMONTH2 as 04 to 12 and 0CALYEAR as Z_YEAR - 1 [Offset decrease by 1]. Now you have Apr - Dec 2012.
Create second RKF by restricting revenue by 0CALMONTH2 as 01 to 03 and 0CALYEAR as Z_YEAR. [now you have Jan-Mar 2013].
Now add these two RKF to get 2012-2013 year date..same way you can do for next previous years..
Please make a key note: in query you have to set to hide key figures if it doesn't have any values - [suppress columns mainly in query properties] to show only months with data...otherwise query output shows all 12 months though you don't have data for furture periods of same year...
Hope this helps you....
Message was edited by: Arun Thangaraj