Formula variable on keyfigure
HI
Can we create a formula variable on keyfigure?
REgards
Annie
Hi
Here my requirement is i am displaying the stock in negative values. So for STCKQTY i put a condition to display the stock which is LESS then -1. So when i execute the query i am getting the stock in -ve values but in OVERALL RESULT i am getting the values of all the stocks for a particular site.
For EX:
Plant............Article........STCKQTY
P100............A100............50
P100............A200............-10
P100............A300............-5
P400.............A400...........-2
P500.............A500...........10
Overall Result ...................43.
The above data is in the cube. But when i exeucte the query the following is the result
Report Data
Plant............Article........STCKQTY
P100............A200............-10
P100............A300............-5
P400.............A400...........-2
Overall Result..................43 But i have to display -17 in my over all result...Is this possible?
Regards
Annie
Similar Messages
-
Regarding Calculated key figure on Formula variable.
Hi Gurus
I have a requirement. My business scinerio in E-recruiting is to find out no of days between requistion creation date and offer made date in each month of year.
For example we have around 120 requistion created in calyender year .
10 requistion in jan , 10 in feb , 10 in march , 10 april , ...........10 december.
my client wants out put as
jan no of days between offer made date to requistion creation date.
feb ,,
march ,,
april ,,
may ,,
june ,,
july ,,
december ,,
i have requistion , req creation date , offer made date , cal period , cal year , no of requistion in my data model.
i am unable to this report.
i have made structure in rows
jan = no of requistion based on calperiod = 1,
dec = no of requistion based on calperiod =12.
in Columns
i created a calculated keyfigure based on formula variable with replacement path of req created date and offer date.
i am not getting the data. my guess is i went some where wrong. please give some advice where i am going wrong . plz help me on this
thanks
roopaHi
Thanks for your reply.
Both req creation date and offered date are in the free characteristics of query.
main problem for me is how to get no of days between offered date - req creation date in jan month.
can you give me exact formula how to write it down in query builder
<b> hi Banu ( Queen of reporting ) can you through ligth n this issue</b>
Thanks
Roopa
Message was edited by:
roopa chow
Message was edited by:
roopa chow
null -
Formula variable not displayed in proper format
Hai,
I used a keyfigure formula variable, that gets current date, in a query (In columns, key figure structure to calculate no. of days). The no. of days are calculated peoperly and everything is just perfect.
But after executing the query, when I display text element=> variables, the system is displaying the variable as 20,060,803 as opposed to date format like 8/3/2006.
Question: Is it how the date formula variable is displayed or there is a system error?
I remember seeing it in date format.
Can somebody comment on this or suggest a solution.
I couldn't find notes on this too!In the restricted key figure formula definition, use the Data function "Process Value as Date DATE" and enclose your restricted key figure calculation inside the date parenthesis.
I have another related problem. I am trying to use dates to calculate 30 days before a (date formula variable), 60 days after, etc. Some of the dates are calculating correctly, but some are just returning an X. All appear to be extracting with the same format.
Anyone have a similar problem? -
Formula variable using date char - unable to use conditions
Hello Experts,
I am sure I am making a silly mistake here - but after spending lot of time I am unable to rectify this - please help if you can:
I basically want the report to show only latest employee actions for a selected period (usually month).
1. I am using formula variable that is based on 0CALDAY and defined as number.
2. A calculated keyfigure uses this formula variable. Both calculated keyfigure and CALDAY char are included in the report / navigation.
3. There is a condition defined using calculated keyfigure. No matter what logic I use, I just cannot use calculated keyfigure to filter records on the report. My original idea was to use Top N - 1 with char combination as 'Employee' to get me the latest employee records for each employee.
Can anyone help spot where I am going wrong?
Thanks.I haven't looked at that, but as a first guess idea- why not use the picker to get a date, then save it as a number of seconds from a given date?
See:
dateWithTimeIntervalSince1970:
Creates and returns an NSDate object set to the given number of seconds from the first instant of 1 January 1970, GMT.
+ (id)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
Or you could store it as a string, but I think the number would be easier. -
G/L Account Formula Variable
Dear All,
I want to take G/L Account value in formula variable, I have created using variable replacement path and key value populating in the variable. But it is not showing in the report. Can anybody give me suggestion on this.
Best Regards,
SGKhi SGK,
Your wrong in doing formula creation . why bcoz 0gl_account is not key figure right. It is related to Dimensions. How u have created formula on dimension variable. If u want create formula variable it should have keyfigure Some times
with Time char ( ex: Keydate,posting date,clear date.... ).
Check it once.
Thanks,
kiran. -
Help in developing 2 Formula Variables in BI 7.0
Hi all,
I need help in framing a Formula Variable. I have the following columns (Key Figures) in my report .....
"Breakdown Time of Machine" (1hr, 2hr, 3hr, 4hr, 5hr)
"Machine count with Breakdown"
From these 2 KeyFigures, how do I develope a Formula which can calculate the following KeyFigures ?
1. "Machine Time with Breakdown Time < 4hr"
2. "Machine Time with Breakdown Time > 4hr"
Thanks in advance & points will be awarded,
SDHi Sebastian,
You define another calculated key figure and use boolean expression, by using the machine break down time. Simple example is given below.
Let us say breakdown time key figure as KF1and new key figure as CKF2. In the CKF2 the formula should (KF1 > 4 ) *1 + (KF1 < 4) * 2.
Now in the CKF2 you will find the values 1, 2 which related to break down > 4 hours and break down < 4 hours.
Hope this helps.
Regards,
Sreenivas. -
Use Formula variable in planning function
Hello,
I would like to use a formula variable in a planning function.
The problem is that when I execute this function all keyfigures values are set to 0 so the FOX is not executed.
The idea is to have something like
= VARV(FORMULAVARIABLE).
How could this be achieved using FOX ?
Or how using an exit function could I call this FORMULAVARIABLE which is not used in the query ?
Thanks,
MatthieuHello Matthieu,
Please search the forum before posting:
http://forums.sdn.sap.com/click.jspa?searchID=70350665&messageID=9814615
Regards,
Marc
SAP Techology RIG
PS: You closed the thread so I have to add some details here. The FOX runtime is hardcoded to 0RSPLS_FORMULA. Therefore, 0RSPLS_FORMULA cannot be copied to a custom planning function type as you suggest.
Edited by: Marc Bernard on Feb 23, 2011 3:36 PM -
Formula Variable with customer Exit (ABAP Code)
Hi Experts,
Please advise me wether i am going in the right way to achieve my requirment else please advise me any alternate approach and update me with the abap code for my customer exit as i am not familiar with ABAP.
My Requirment:
Data :
Emp_ID----Start_Date(DATS)---End_Date(DATS)
I had a user entry (intreval) VARIABLE created on Start_Date
User will enter the date intreval he want to analyze...
Ex: 01.01.2008 to 01.02.2008
Now i want to use the No of Days between user entered date intreval in my calculaction of a keyfigure
In the above example it is 31 days
So i created a Formula Variable of Customer Exit now i need a code that will
pass the user entered dates to
FM: FIMA_DAYS_AND_MONTHS_AND_YEARSImport parameters Value
I_DATE_FROM 01.01.2008
I_DATE_TO 01.02.2008
I_FLG_SEPARATE ' '
Export parameters Value
E_DAYS 31
E_MONTHS 1
E_YEARS 1
and need to pass the E_DAYS (31) to the result of formula
User Entry Variable (Intreval) : ZST_VAR
Formula Variable (Customer Exit) : ZND_EXIT
Code
WHEN 'ZND_EXIT'.
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
ls_varrange-low = low_date2.
ls_varrange-high = high_date2.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endif.Hello,
Before the WHEN statement it shoud have a CASE statement. In the user exit coding place your WHEN statement anywhere between CASE...ENDCASE statement.
your code should look like
DATA: low_date2 TYPE d,
high_date2 TYPE d,
num_days TYPE N,
new_low_date2 TYPE d.
Case i_vnam.
WHEN 'ZND_EXIT'.
IF i_step = 2.
LOOP AT i_t_var_range INTO ls_varrange WHERE vnam = 'ZST_VAR'.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
low_date2 = ls_varrange-low.
high_date2 = ls_varrange-high.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = low_date2
I_DATE_TO = high_date2
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = NUM_DAYS
l_s_range-low = NUM_DAYS.
APPEND l_s_range TO e_t_range.
EXIT.
ENDLOOP.
endcase.
Thanks
Chandran -
Formula Variable with customer exit
Hi,
can we use Formula variables with customer exit based on characteristics(ex Bill date)? if yes, can you guys help me on this.
Thanks
kriYes , you can use a formula variable with customer exit based on characteristics .
Depends on the requirement what you want to show in the formula variable ,
Eg : if you want to show the max fiscal year period , in that case :
create a new formula in the keyfigure section of your query , go to edit , you can see formula variable below the keyfigures ,
right click on the same and create new formula variable :
Write the code for the formula varible in the backend as we do for normal customer exit varaible :
for this e.g the code will be :
FORM get_variable_value
tables E_T_RANGE type RSR_T_RANGESID
using I_VNAM type RSZGLOBV-VNAM
I_VARTYP type RSZGLOBV-VARTYP
I_IOBJNM type RSZGLOBV-IOBJNM
I_S_COB_PRO type RSD_S_COB_PRO
I_S_RKB1D type RSR_S_RKB1D
I_PERIV type RRO01_S_RKB1F-PERIV
I_T_VAR_RANGE type RRS0_T_VAR_RANGE
I_STEP type I.
DATA L_S_RANGE LIKE LINE OF E_T_RANGE.
DATA loc_var_range LIKE rrrangeexit.
Data : l_inPer TYPE string.
IF i_step = 1.
Select min( distinct FISCPER )
from /BIC/A(DSO name)
into l_minper .
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = l_minper .
APPEND l_s_range TO e_t_range.
endif.
drag the formula variable in the new formula created and exexcute the query , you will be able to see the output .
This is just an example , your code will differ as per your requirement . -
Getting count - formula variable
Hi Guys,
Need you help.
I have a cube with data like this:
Division | Customer | Keyfig1 | KeyFig2
D1 A 10 20
D1 B 10 20
D1 C 10 20
D1 D 10 20
D1 E 10 20
In my Query i need to get the count column. Output should be like this:
Division | Count | Keyfig1 | KeyFig2
D1 5 50 100
Now count is 5 since Customer for that particular division were 5.
So i created a formula variable on customer with customer exit.
Now i need is some how create a calculated keyfigure - count(Customer formula variable)
Customer Formula Variable = COUNT(customer) in the user exit.
I tried with Customer with replacement path but i u need customer in the query inorder it to work since i dont want customer in query.
How to code this? will it work?
RegardsI am afraid that if you can actually get it done with customer exit, remember customer exit will be executed before pop up, after pop up in Step -1 and Step-2 and of course to validate screen selection variable value which is step-3. Basically, the customer exit will be executed only once before the variable popup or after the variable popup in the selection screen.
I have actually managed to count the number of customers without the customer being in the query rows. you just need to hide it and with the replacement path you will be able to acheive what you need. And also if you are in 7.0, then you can create a formula which will put '1' for every new records and use a reference characteristics "customer".
Hope I am clear.
thanks.
Wond -
Formula variable - Maximum Date in result output
Hello Guys,
Scenario -
Data in Cube
*Reseller Sales Date*
RS1 01.01.2010
RS1 01.01.2011
RS1 01.01.2012
RS2 01.01.2008
RS2 01.01.2009
RS2 01.01.2010
Required Output - Display one record for each Reseller with recent Date.
*Reseller Sales Date*
RS1 01.01.2012
RS2 01.01.2010
What I did till now --->
Created a Formula and included a Formula Variable (replacement Path ref char - Sales Date) hence I got the date as keyfigure.
Reseller Sales Date Sales Date Formula
*RS1 01.01.2010 201,00,101*
*RS1 01.01.2011 201,10,101*
*RS1 01.01.2012 201,20,101*
*RS2 01.01.2008 200,80,101*
*RS2 01.01.2009 200,90,101*
*RS2 01.01.2010 201,00,101*
For the Sales Date Formula (Calculation tab - Calculate result as Maximum) to display the result as maximum.
The issue is that when I remove the Sales Date from Drilldown the Sales Date Formula display X. I was expecting the result row to be displayed i.e the maximum value for RS1 and RS2.
Can you guide where I am going wrong... or any other method to achieve the above output is appreciated.
-AmitHi,
Through replacement path you can achieve this.
On row side put *Reseller.
on Column side create a formula(and on Aggregation Tab: Exception Aggregation: Last Value, Reference Characteristics: Sales Date)
and there create formula variable and use replacement path.
Details
Type of variable: Formula
Processing By: Replacement Path
Reference Characteristics: Sales Date
Replace variable with: InfoObject
Replace With: Key
Dimension: Date -
Issue in query transport ( formula variable)
Hi Experts,
I have issue while transporting a query.
I have created two formaula variables, with them created a calculated keyfigure.
The transport of this query was failed with return code 8 with Error message 'Element 4XDRFT... is missing in version M'.
Diagnosis:
Element &1 in version &2 referenced but is not active
System Response:
The action had to be terminated
Procedure:
Please supply the missing elements to the system by a transport
The two newly created formula variables are giving error with above message.It is showing these variables are missing in version M
Can you please help me where i am missing and how to resolve this issue,
Regards,
Mohd.Hi,
You did not collect all elements while transporting.
Try to collect the missing elements in a new transport request and move.
You can identify the missing Elements description from table RSZELTTXT.
go to SE16 > RSZELTTXT > give ID as "4XDRFT..." > hit execute to see the missing query element description
Hope this helps u...
Regards,
KK. -
Calculating with formula variables of type user exit
I created the following query:
Rows: Characteristic = Employee
Column: KYF = Status
Filter: Year, Month
The KYF ist a formula containing a formula variable. This variable of type user exit should return a value recording to the value of employee and has to be read in a customizing (data-) table by the user exit.
Is it possible to read the values of employee row by row from the internal table which contains the amount of data before processing to output screen and fill the 'Status'-KYF or should I create a virtual keyfigure for this case.
Thanks for all your feedback,
AngelikaHi,
It seems like Status is master data of Employee.
As per your process, if you do either formula variable or virtual keyfigure you will face query performance problem. More over you cant simply access record by record characteristic value in formula variable. It will be another complex process like you have to call the characteristic value via replacement path.
You have the following choices:
You mentioned master data is availabe in custom table. Try to pull the custom table master data into employee info object. Maintain status as one of the attribute of the master data. Then you can display Status value simply in the report. This will be global access like you use this Status value n number of info providers which is having Employee as one of the info object in the info provider.
If the previous way is not possible, include the Status in the info provider level and write a simple update routine to populate the values. This will be info provider level.
I am not sure whether you are in development environment or productive. If developement, then you can choose simply any one of the above ways.
Regards,
Vivek -
Hello Gurus
I have couple of questions:
1) Using an Infoset, I want to do the following - Start with a Cube and do a left outer join with another ODS and in the same infoset do a left outer join between the Cube and an InfoObject. Is this possible?
2) I have a keyfigure which is an attribute of a InfoObject and hence it cannot be a navigational attribute. So to use that keyfigure in the query, we are using a formula variable and populating that keyfigure as a replacement path. However, the values for the keyfigure are being rounded off in the query. for e.g. if the value of the keyfigure in the master data attribute is 21.84, it is being displayed as 22.00. What setting could I be missing. I tried everything in the keyfigure setting?
Any help is appreciated.
Thanks,
RishiAjay ,i would still repeat ,its 0FISCPER and not )posting period ,data model do not have posting period itself as infoobject
also for Sam,
it uses 0DATE and i use 0FISCPER so that link do not help ,moreover they use the dimension ID = DATE i cannot use that as am not counting the date fdiff or number of days here
thanks
can any one give me precise soln ,be great -
Hi all,
I created a formula variable type amount (so I can select my currency EUR), the user enters a value in the popup screen...
but when I display this value, the currency is not displayed...
I tested this also on another system, and I have the same problem.
please advice,
Joke
we're on BI 7.0Hi Joke,
1. Try to check by adding one amount keyfigure and execute the report and check whether the units are displaying for that keyfigure.
2. Try to creat new formulia variable and add in formula with the below settings:
Formulia Variable:
processing type: user entry/replacing path.
Variable entry is: Mandatory.
Ready to Input: selected.
Dimension Indicator: Amount.
Currency: Eur.
Default Value: 50,000.
Add this formulia variable into the formula. Save the query and execute.
I executed with the same setting which are mentioned above, it is displaying 50,000.00 EUR in my report.
try this and let me know.
Regards,
Siva.
Maybe you are looking for
-
How to get the localization in adf
Hi Experts, Can you please tell me how to achieve the localization in adf application.?? I want it to support for based on locale.. Can you please tell me the procedure.... I am using jdev 11. Here I need localization in VO layer.not using resource b
-
"Serious Error has Occurred" message with Windows 7
Just upgraded to Windows 7 64-bit and when trying to open a CS4 project I'd been working on in XP 32-bit I get an error message saying: Adobe Premiere Pro Sorry, a serious error has occurred that requires Adobe Premiere Pro to shut down. We wil
-
How do i restore my phone using the ipsw from an external hard drive
I am currently deployed to Afghanistan and don't have very good signal. One of the guys thought it would be funny to change my passcode, and then forgot it. Now my phone is disabled, and the computer I used to set it up is in the states. The signa
-
Aperture freezes on print dialog
I've noticed a reproducible problem with printing. When I call up the Print Image command from the File menu, I'm presented with the Aperture print dialog. If I then click on Print, it calls up the print dialog for my Epson Photo Stylus R3000 printer
-
plz help me i got this error while config mapviewer in NetBeans May 29, 2008 10:04:39 AM org.apache.catalina.core.StandardContext start SEVERE: Error in resourceStart() May 29, 2008 10:04:39 AM org.apache.catalina.core.StandardContext start SEVERE: E