Related toquery formula variable

hi
gurus
my situation is , i am developing a query for hr MASTER DATA
HERE  I GOT ROW  BY NAME             DATE OF BIRTH (EMPLOYEE DOB)
NOW I WANT TO GET                               AGE ( of employee based on the  DOB)
HERE I AM THINKING OF USING VARIABLE LIKE  CURRENT MONTH   OR CURR DATEIF WE GET THIS  WE CAN SUBTRACT BY FORMULA     
    AGE - DOB
CAN ANY BODY HELP HOW TO  GET AGE ROW .
IF USING OF VARIABLE IS CORRECT THEN WHAT IS THE PROCEDURE .
THANKING U IN ADVANCE

Hi,
Formula Variable would be the first solution coming to the mind in such a case. But with a formula variable, you would be able to create key figure, but i think (not very sure) that you want it as a characteristic to drill down against the DOB.
Now if you want to go with formula variable, here is the approach.
Create a formula variable as replacement path of DOB (DATE type). Now in a formula, subtract it from system date. This would give you the number of days. Use Whole number(number of days/ 365) as the age in years. For months too with the year, it would be ((year*365) - number of days) / 30.
But if you need a characteristic value instead of a key figure, you can instead go for virtual characteristic. In that case, you need to include a characteristic in your cube, not map it in the transformations. Next, you write a BADI or CMOD routine to populate the characteristic during report run time, based on a similar logic as mentioned above. Virtual Characteristics are a bit performancce intensive too, so please be cautioned.
Hope it helps.
Thanks,
Abhishek.

Similar Messages

  • 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?

  • 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,
    SGK

    hi 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,
    SD

    Hi 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.

  • Get value of formula variable during query runtime into a text variable

    Hi all,
    I wanna get the value of the formula variables during the query runtime into a text variable.
    My scenario is like this: First I defined a formula variable Z_DATE_3 which is processing by replacement. It will get the day of a characteristcs(Startdate).
    Then I defined a text variable and in the function module related to this text variable, I used the parameter I_T_VAR_RANGE which can store the value of formula variable during the query runtime.So I can read the value from this table in my function module.
    But I have a issue, when I run the query which used the defined text variable, it seems that it doesn't call the corresponding function module. Because I set a breadpoint in hte code and it never reach this breakpoint.
    If I removed the parameter I_T_VAR_RANGE , it can enter the function module.
    So could you please give some advice?
    Is my solution correct or not?
    And what's wrong with the parameter I_T_VAR_RANGE? Did I use it correctly?
    And My code is:
    DATA:  l_s_range_v TYPE rrrangeexit,
                 l_day type sy-datum.
    if i_step <> 2.
    raise no_processing.
    endif.
      READ TABLE i_t_var_range INTO l_s_range_v
         WITH KEY  vnam = 'Z_DATE_3'.
    if sy-subrc = 0.
         l_day = l_s_range_v-low.
    endif.
    Thanks in advance!
    Best regards
    Fanchest

    Hi, Fanchest,
    I'm having just the same issue.  Did you find a solution?
    I wrote a short routine in CMOD to derive the value of a formula variable to a text variable, but it's not working (I don't get any value).  Can you share your solution?
    Thanks in advance,
    LL

  • A formula with a formula variable with a replacement path delivers X

    A formula with a formula variable with a replacement path delivers X as a result if the characteristic of the replacement is not in the drilldown
    I have Created on ( date ) on which I have a Formula variable . I have used that Formula Variable in my calculated Key figure .
    Now the Problem is If I use Created on in ROW , The calculated key figure works . But if I don't use in Row , The calculated Key figure shows X . Situation is Users don't want to see Created on in ROW .
    If I use in row and hide also , then number of Records  will be same .
    Pls guide me what shoud I do .
    Is this problem related to support pack .

    hi
    i would like to know how to create the replacement path and authorisation variables.
    what are the steps we need to follow in rsa1.
    Edited by: vasu reddy on Apr 9, 2008 11:28 AM

  • Formula variable user exit.

    Hello experts;
    I will provide max points for help with this.
    In query designer can I access a key figure from another cube and use it in a formula?
    I cannot use multi-cube in this solution so I was looking into creating a formula variable using a user exit to access a key figure stored in a different cube.
    Ex:
    I have a Tracings cube with customer and material cost information.
    I need to calculate the cost per patient for Absorbent material.
    I can get the customer cost for Absorbent material but the number of patients is stored in a different cube called Census information.
    Since the Census information is not related to a material (only customer) I cannot get the number of patients together with the cost of the absorbent material. I was hoping to access the Census information (number of patients) from the query calculating the cost per patient.
    Thanks
    Den

    I really don't see how you can implement it using exit variable even if you can read data from other cube in exit. If you still want to explore it, refer the following thread - How to read data from an InfoCube in BI 7.0?
    Why can't you build a multiprovider - these kind of requirements are precisely the reason why multiprovider is there (when you need information present in multiple infoproviders in the same report)

  • BW 3.5 - Issue with formula variable with replacement path

    Dear experts,
    I'm facing an issue with formula variable with replacement path.
    Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
    I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100 €
    To do so I've setup a calculated key figure as follow:
    VAR1 * ("PO value" < 100 ) * "PO value"
    VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
    (The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
    The report as characteristic "plant" in rows and my CKF in columns.
    Now let's take an example. I have 3 POs in Plant 1:
    PO1 -> 150€
    PO2 -> 90€
    PO3 -> 80€
    Because of the variable with replacement path, the result in my query should be:
    plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
    But the result coming is 320, which is wrong.
    I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
    They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
    Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref  characteristic 'constant =1' ...
    Any though is welcome!
    thanks

    Hi,
    The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
    To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
    Regards,
    Patricia

  • Error in creating Formula Variable

    Hi All:
    I'm having problems in creating formula variable. Trying to create FV on a characteristic using replacement path with attribute value , but the wierd part is it's not giving me any attributes it's just blank. Any help would be appreciated....
    Thanks,
    Manasa.

    Right click on the FM, create -> Characteristic -> attribute value -> but the attribute are not showing up.  This happens if the attribute is of key figure type. I was able to do this in another system (ASIA DEV) but now trying in Europe Dev.

  • Formula variable in Report painter

    Hi
    Normally when ever you create a formula varibale for year or period system will
    check the period and year from current system year and period(S001 and S002)
    I am looking for a solution where i can create variable which is independent of
    current year and period.
    Lets Say if i give 2006 and period 7(of 2006)system has to give results
    in the predefined columns like 2006 of period 7 and 2005 of period 7 and 2004 of period 7 and 2003 of period 7(I have 4 columns)
    Can any one tell me how to create this using the formual variable,which will allow
    me to select in the input screen any period and year and display the results  as per my own requirement.
    Thanks
    Lily

    Hi Ramachandra
    Sorry for late reply
    As per your reply,i am not still clear,can i put in more clear my question again
    Selection screen 
    Year-2006
    Period-6
    I have 5 columns ,can you specify me the formula for 5 columns in your reply.
    Column1- (it has to display 2nd  quarter of 2006)
    Column2-(it has to display 1nd  quarter of 2006)
    Column3-(it has to display 4nd  quarter of 2005)
    Column4-(it has to display 3nd  quarter of 2005)
    Column5-(it has to display 2nd  quarter of 2005)
    Pls specify me FYEAR and Period from and period to which formula variable i need
    to use,how many variables i need to create for this purpose.
    Keep in view that selction screen i can give 2006,or 2005 or 2007,but system has to display 5 quarters back data in in 5 columns.
    This is urgent,can you pls help.
    Thanks
    Lily

  • If condition in Formula variable

    Hi forum,
    Can anybody please help me write the formula below in formula variable.
    *If A >=0
    then
    result = (A/B100365)
    Else
    result = (A/B100365-1)
    Thanks in advance for the efforts.
    Regards,

    (A>=0)(A/B100365)+(A/B100365-1)
    do a formula check.
    Khaja

  • Default Value in Formula Variable - Inconsistent behaviour

    Hi,
    I am facing a very strange issue in a formula variable.
    I had created three formula variables with default values and the user (Power user who has the Bex access) was able to change the default value themselves for two of these variables.
    Now he wants to change all the three, so I have tried to check the issue and changed all the three for testing purpose.
    Now, he is unable to change any of them!!! Sad, now I cant even say that "You dont have the Auth to do so"
    Any clue? Anyone has faced similar issue.
    Any thoughts are highy welcome! Suddenly users wants to get this one URGENTLY, usually he used to access the report once in month. Now he wants to use the same once in half an hour
    We are on BI 7.0 with SP 24
    Any thoughts PLS
    Regards

    hi,
       probably you can refer to SAP Note 1413030 - SAPBWNews NW 7.x BW Add-On Frontend Patch 1300 - GUI 7.10 or maybe  SAP Note 1294382 - SAPBINews NW7.0  BI Add-On Frontend SP900 - GUI 7.1 that might help you in sorting out your problem, plus you can buy more time from the user as well
    regards
    laksh

  • Prompts issue and Formula variables.

    Hi,
    1. I have a variable in Bex report as Creation date, but when it comes to webi the default prompts comes as creation date(From) and Creation Date(To). Is there anyway to modify or delete these default prompts.
    2. In one Bex report , i have a formula variable purchase order, based on this only the report output(as a condition) is displayed.I think that the conditions are not transferred from bex to webi, because the webi output is standard for all values of the purchase order. Is there any way to delete the default purchase order prompt

    Hi
    Answer to Q1.
    There would be a Filters specified to prompts DATA as creation date(From) and Creation Date(To). You have to change the filter condition as REQIRED.
    Answer to Q2
    FORMULA variable is not transfer to WEBI. You have to define a NEW FORMULA in the WEBI Query Designer.
    Hope its a use ful info..
    Regards

  • Help with formula variable that will give me period #

    column A = $  for fiscal year period  variable  (using 0RMA_FIP,  SAP delivered variable for period)
    Column B = $ for fiscal year period  variable minus 1  (previous period)
    In Column C,  if fiscal year period entered in 0RMA_FIP was 001/YYYY  (january)  I want column C to be zero,  if not,  it will be a variance between column A & Column B.
    I think know how to do boolean logic:  (FV_Period == 1) *0 + (Column B % Column A)
    What i am having trouble with is creating FV_Period  as a replacement path formula varialbe so that it will contain the value of the period,   1 for January,  or 2 thru 12 for other months..

    While creating the Formula variable with replacement type, you need to mention the offset start and offset length.
    I believe if your Fiscal Period is displayed as 2010009 then
    offset start = 5 and offset length = 3 should give you the value 009 which is required.

  • Problem with formula variable

    HI,
    I am facing problem with formula variable with replacement path. my requirement is system date - posting date.
    here i created 2 formula variable one is system date. second formula vaiable with replacement path is posting date. second formula vaiable not populating data. please help on that.
    regards,
    kris

    Hi,
    here is some idea.. here i have taken expample dates 1)notification creation date and 2) notification completion.
    1st:in the query designer at key figure coloumn create
    one local formula.in that local formula create formula
    variable with replacement path.in that take reference character
    notification completion.in the next tab take replace ment
    as key.in the last tab select "date".
    2nd: do the same thing for the notification creation date.
    3 rd : create 3 rd local formula and do the substraction
    for the first 2 local formulas.
    4th:create codition on the difference which u have find with
    on that condition u can create one user entry varibale.
    5th:while u defining the query put these 2 dates,i,e
    notification completion, notification creation date in the character block.
    If not system will ignore the formula variable which u created in
    above steps.
    Hope this wil help u.
    regards....KP

Maybe you are looking for

  • Withholding tax postings for a single line item during invoice posting

    Hello folks, I have a question from my client about withholding tax postings during invoice postings. Scenario is 1. There's a PO with multiple line items. 2. A vendor invoice is posted against this PO which has multiple line items. Not all line item

  • SSRS 2008 - ServerReport.SetParameters() suddenly extremely slow

    Hi, We have been using SSRS 2008 R2 for quite a while now but 3 weeks ago we started to notice some performance problems when generating SSRS reports. We have a .NET client which gets the list of reports from the server and then the end user can sele

  • Ipod touch Out going mail problems

    Prior to downloading 2.0 for my Ipod touch I had no troubles sending emails via my verizon DSL. I put 2.0 up on the ipod I can not send emails. I have tried to redo the setings, but the ones that show are correct. I have searched the ipod mail help s

  • Transcodage de fichier Transcodé

    bonjour je rencontre un problème avec Encore cs6 lorsque j'importe un fichier deja transcodé avec premiere pro cc ou ame cc pour faire un bluray fichier transcodé en h264 bluray ou bien mpeg2 bluray Encore cs6 me refait un transcodage avez vous deja

  • Possible to deconstruct a droplet?

    I made a droplet with Photoshop CS3 or CS4 (I can't remember which). I've been using this droplet once a month since it was created. With the 64-bit version of Photoshop, I'd like to recreate the droplet so I don't need Rosetta to run it. But I don't