cancel
Showing results for 
Search instead for 
Did you mean: 

calculating QTD based on month without using ABAP logic

Former Member
0 Kudos

Hi gurus,

     Can you please let me know how I can calculate QTD based on 0CALMONTH without using any ABAP logic or exit in BEx Query Designer?

When I try to use Structures in Rows to create cell restriction to calculate QTD, I am not able to add 0CALMONTH to the selection in the Structures.

Can anyone please help with these questions?

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member183777
Active Contributor
0 Kudos

Are you using 0CALMONTH in another strucutre such as in a key figure restriction. If you create a new quewry and start with a structure in rows and under the structure create a selection lets say Q1, drag 0calmonth to it and restrict it to 1 to 3 range. Should work

Loed
Active Contributor
0 Kudos

Hi,

May I ask why you do not want to use CMOD in this requirement?

Anyway, try this:

You need to have 0CALQUART1 object in your provider..

1. Let's assume your input variable is called INPUT_MONTH..

2. Create a formula variable for 0CALQUART1 with replacement path, let's call it FV_QTR..

Reference characteristic is 0CALMONTH..

In replacement path tab, select replace variable with VARIABLE..Then select the variable as INPUT_MONTH and replace with KEY..Use interval as FROM VALUE and put offset start with 4 and offset length with 2..


3. Create four (4) SELECTIONS (HIDE all these selections):

QTR1 = KF with 0CALQUART1 field restrict to 1

QTR2 = KF with 0CALQUART1 field restrict to 2

QTR3 = KF with 0CALQUART1 field restrict to 3

QTR4 = KF with 0CALQUART1 field restrict to 4


4. Create a FORMULA, let's call this QTD, and write this formula..


( FV_QTR = 1 OR FV_QTR = 2 OR FV_QTR = 3) * QTR1 +

( FV_QTR = 4 OR FV_QTR = 5 OR FV_QTR = 6) * QTR2 +

( FV_QTR = 7 OR FV_QTR = 8 OR FV_QTR = 9) * QTR3 +

( FV_QTR = 10 OR FV_QTR = 11 OR FV_QTR = 12) * QTR4



Just post here for questions..

Regards,

Loed

former_member186696
Active Contributor
0 Kudos

Hello Aparajitha,


Without ABAP, I can't see any solution, sorry.
All examples uses customer exit. e.g. http://scn.sap.com/community/business-explorer/blog/2013/12/18/derive-qtd-quarter-to-date-from-0cald...

Regards,
Edward John