Formula variable and agregation

Hi,
I want to use price of materials (form ATTR) in a query (multiplied with quantity from transactional data).
A formula variable was created and working fine when materials is also displayed in a query. But I would like to create a query based on material group and material should not be displayed.
Is this possible and how (aggregation, properties, ...) ??
Thanks and regards,
Tomaz

Try creating a global calculated key figure with the same definition as the one that you created locally in the query.
Global calculation occurs before aggregation, so this should solve the issue you are having by getting incorrect values when you do not display material in your query.

Similar Messages

  • Formula Variables and their use

    I have a scenario where I have a date selection using a variable.
    I get from and to date defaulted to 1st day of the month and current date
    Next, I created a formula variable to calculate the difference between these 2 dates.
    I can't uses replacement path variable to calculate the difference becaue the dates are not part of the transaction data.
    When ever I bring formual variable into a formual it gives an error
    Terminate: Variable D1QDQC684JU76RD3FQ10GECZ9 (D1QDQC684JU76RD3FQ10GECZ9) does not exist or is incorrectly used D1QUMP50BGW24SQ9PQMZDSMD1 [A418(BRAIN)]
    This error is not in the customer exit. This error happens in the query designer design phase during syntax checks.
    Thanks for your help
    Kartik

    there was a problem in defining the variables, while u r opening your query, and if its getting terminated means, definition of the variable and its usage is wrong somewhere else.
    Here is the step by step procedure for Formula variables:
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html

  • Formula Variable and Exception Aggregation

    Hello
    Please can you explain me how this works.
    There is formula variable created on a change date.(Replacement Path) with replace with Key.
    Then this formula variable is put in a formula as NODIM(Formula Var) and the exception aggregation is set as Total with Ref Char selected on the same date(Change Date).
    Now this is coming up with values like 2202374. If i remove the exception aggregation then i get an X in the values. If i then include the change date in the rows i get the date.
    Please can anyone let me know how this would be working. Effort Appreciated.
    Thanks

    Here is a scenario that might fit:
    Formula is trying to show the latest change date without adding it as a drill down. The only discrepancy is that the exception aggregation would need to be set to maximum value instead of Total.

  • Formula Variable and key date

    Hello!
    Maybe someone can help me with the following problem:
    We have an inventory cube and want to see our stock with alternative values. On 0Material exists a key figure ("price") as time-dependent attribute. This key figure displays the price of the material for different periodes (that's why attribute is time-dependent).
    In the query I created a formula variable (=> replacement path, replaced with the mentioned key figure "price") and in a formula I multiplicate stock and the formula variable. This works fine and value of key figure "price" is correctly selected according to key date of the query.
    But I need a second formula, where stock from previous year is multiplicated with "price" from previous year, so I need a possibility for a second key date relevant for a second formula variable.
    Anyone who had a similar problem? Any idea how to solve this problem - formula variables are not mandatory!
    Br
    Gunter

    Hi Kishore,
    Use the formula created by you (say Formula 1) in a new formula ( say Formula 2).
    Use If Else condition.
    Formula 2 = (Formula 1 < 0)0 + (Formula 1 >=0)Formula 1
    The above expression explained as:
    If Formula1 < 0 then
      Formula 2 = 0
    Else
      Formula 2 = Formula1.
    You can hide Formula 1 and Display only Formula 2 in your report.
    Hope this helps!

  • Infoset and formula variable

    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,
    Rishi

    Ajay ,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

  • Formula variable / Replacement path issue

    Hi Experts,
    I have a Field which has different status description.
    I want to bring the count of only one preferred description.
    Model Status
    A1     New
    A2     Open
    A3     New
    B1     Closed
    B2      Pending
    B3     New
    I want to view only the closed count of models
    Model Count of Closed
    A1     0
    A2     0
    A3     0
    B1     1
    B2      0
    B3     0
    I tried doing this using the formula variable and Replacement path with Status Field.
    But I'm unsuccessful in selection the desired status.
    Please help me to over come this.
    Thanks

    Hi Dear Prasad,
    I can't restrict the characterstic to Closed. If I do so the output will be only for Closed.
    But here I want to bring every model with value as 0 and 1 for model with closed status.
    Hi Dear Raju,
    The requirement what I have here is more complex. like, the result will be for 6 month displaying every single cal/day.
    and also I have to find out percentage of closed for every cal/day based on number of model we got.
    i have only asked a small portion of it, with this input i will manage to build the percentage etc....
    I  cannot bring counter inside. My report is already too wide to be displayed.
    I have tried similar kind of thing, using CKF, Formula Variable and Replacement path with the Char - InfoObj.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a&overridelayout=true
    But I'm not very sure how do I get only count of the my desired status.
    Please help.
    Thanks

  • Exception color with formula variable(replacement path)

    Hello,
    I tried to define exceptions in a query which "from" and "to" values
    are determined by formula variables with replacement path. I checked
    the values of the formula variables and they are right. <b>But <b>the cells
    are not colored</b></b>. When I set the same values in the field "from" and "to" without variables : the colors appear.
    Could help me to resolve this problem please ?
    Catherine Bellec

    Hi Alec,
    You are right, the user exit permits to color the lines.
    But the value of my variable needs to change for each line of the infocube so I can't do this with the user exit RSR00001 because it concerns global variables.
    That's why I used a replacement path on a virtual characteristic.

  • Date Difference between to date formula variable

    Hi Expert,
                    I have create two formula variable one for Document Date and another one for Goods reciept date
    and through formula variable I am subtracting these two formula variable and getting the no. of days between
    document date and GR date.
    This Shows me the correct value for one document date because i am filtering my query according to document
    date,
    while i am giving the date range for document date is shows me incorrect result. bucause document date formula
    variable contains only one date.
    Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
          In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
    value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
    formula variable bring the same date like 01.02.2010.
    Please tell me the solution
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                     Actually i have created two formula variable on for PO date and another for GR date
    and i've restrict the query through PO date.
    while i am taking the single PO date in Selection parameter it showing me correct difference
    eg: Selection Parameter for PO: 01.01.2010
    But while i am taking the date interval for PO date
    eg: 01.01.2010-30.01.2010
    PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
    PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
    Thanks and Regards
    Lalit Kumar

  • Formula Variable in WAD (Counts) Not Displaying

    Hi Gurus,
    I am using BI7.0.  I have a query that analyzes a charactersitic, such as Priority, uses 2 date (charactersitic[Create Date and Close Date) fields.  I created a new forumla variable, using a Replacement path, to calculate the difference between the dates to derive the difference between the dates and a formula variable to derive the average number of days between the dates.  That is working well.
    However, when using the Bar Graph or the Pie graph I can not see the value of the formula variable that contains the average number of days. 
    I am assuming that because the key figure is a formula variable and not a 'key figure' then I would need to remodel my date fields as Key Figures in order for the Web Items, such as Pie/Bar Charts to view them.
    Has anyone seen this before.....is there anything I can do at the query level in order for my formula variable to show up in the WAD?
    Thank you

    Pallavi
    You are correct.  I had to select the "show summary/total" on the Web Item properities and the results defaulted.
    Thank you

  • How to assign current date/time to a formula variable in Query Designer

    How do I assign the current date to a formula variable in Query Designer? I need to use current data in a calculation and just need the date the report was run.
    Thanks

    Hi Philip,
    There is an SAP formula variable to supply the current date in a formula. I think it is 0F_ADAY...install it from business content if you cannot see it in the query designer (formula box, under formula variables) and try using it.
    Hope this helps...

  • How to create formula variable on system date.

    i want to calculate inventory age as on today. i have create formula variable on inventory creation date. i want to create <b>formula variable on system date.</b>

    simply create a formula variable and set the processing to "by user exit"
    in the user exit assign sy-datum to the variable

  • Formula Variable Question

    Hi
    I have to calculate No.Of Days Open for a Case. We have Created Date and Closed Date Characteristics.
    Calculation:
    Closed Date - Created Date (If Closed Date is not #)
    else
    Current Date - Created Date.
    I have created two Formula variables on Created and Closed Dates and Used Current Date SAP Exit variable.
    Formula1: Current Date - Created Date
    Formula2: Closed Date - Created Date
    RKF1: Formula1 and Closed Date = #.
    RKF2: Formula2 and Closed Date NE #.
    No.Of Days = RKF1+RKF2
    Whenever Closed Date is blank, Formula 2 is giving "Does Not Exist" in the Output.
    I tried with NOERR, DELTA functions to get zero value in Formula2 for Closed Date = #
    But none of them worked. Surprizingly If I pull Closed Date into the Report, it is showing zeros.
    Can anyone guide where I am doing mistake?
    Best Regards,
    Sree

    HI Parth,
    I am having one issue in CKF.
    Original data:
    Compcode   Caseno.     CreatedOn    Amount
    1000         A        06/18/2011     100
    1000         B        06/19/2011      50
    1000         C        06/18/2011     150
    I have created one CKF for No.of Days Open. It is difference of Sy-datum and Created Date. I used two formula variables and used
    them in the CKF.
    Let us say today is 06/22/2011
    Report Layout:
    Caseno and CreatedOn are Free Characteristics
    Compcode  No.of Days Open   Amount
    1000          4              300
    When I bring in the Case no I am getting below result: It should show No.of Days Open as "3" for Case B. Somehow it is always
    taking maximum difference number and showing for all cases.
    Compcode   Caseno.   No.of Days Open  Amount
    1000         A           4            100
    1000         B               4          50
    1000         C               4            150
    When I bring in Createdon then only it is showing correct value for all cases. I tried with Exception Aggregation with reference to Caseno.
    CreatedOn etc but didn't get the correct result.
    Question: Could anyone identify the problem in my Query design? Thanks for your help
    Best Regards,
    Sree

  • Formula Variable

    Hi Guys,
    I have o calculate no. of days as a difference between 2 dates. I can use Formula Variable to do the same. I however cant't have both the dates in my report (in rows). Hence Formula variable doesnt work.
    Any other work around guys?
    Cheeers
    Kirk
    I promise to award points for all the helpful answers.

    hi,
    fo clarification:
    is it tht u cannot keep both the dates in rows or u cannot keep both the dates in the same query.
    if 1 dates is  in rows and another in column and if the formula variable(needs to be displayed only in columns)then u have one solution...
    to use :'Cell definition'.
    for this we need 2 structures.
    Create a structure in rows with selection date1 .
    create another structure in columns with the formula variable and date2.
    then press on define celll on the top bar of query design...and type ur formula in the intersection.
    if this is not wht u want ....
    mail me a screen shot with the description.
    id:[email protected]
    reward points if it helps.
    regards,
    Dhanya.

  • Formula Variable issue

    Hi,
    Can someone help me with the following issue as my client wants it quick.
    I have created a formula variable called "Enter number for formula" for number and used this formula variable  in a calculated key figure. When I run the query, it will ask me to enter a number in the formula variable and this number will be used in the calculated key figure to get the results for the calculated key figure in the report.
    Now the point here is that customer has to enter either 5 or 6 or 7 only in this formula variable and should not allow other numbers in the formula variable and more over we should have a selection option with only these 3 values and when customer pressses F4, he should get an option of selecting any one from these 3 values.
    Is this requirement feasible? If So can any one help me with an example.
    Advance Thanks for your help.
    Kishore

    Hi Aby,
    I have a quick question. My first priority is that, is selection option can be enabled for formula variable i,e when ever customer executes a query and presses F4 he should get 5 or 6 or 7 and has to select any one out of three.
    I can give the formula variable description "Enter either 5 or 6 or 7" but this can be worked out only if I have less values but if I have to select some numbers from 1 to 100 then definitely I need a selection option,
    and is the reason we are looking for selection option with the required values.
    Can you please help me with this.
    Thanks,
    Kishore

  • Customer Exit to derive formula variable to text variable (BW 3.5)

    Hi gurus,
    I have created a formula variable in a BEX report (BW 3.5) that is fill by the user during runtime.  This formula variable is used in conditions and other key figures in the query.
    What I need now is to use the value given by the user in this formula variable and expose it in a text variable.
    The variable properties are as follows:
    VARIABLE 1: 'MONTOANA'
    Type of variable: formula
    Processing by: user entry
    Variable entry is: mandatory
    Ready for input?  YES
    Dimension ID: Price  (currency: Argentine pesos / Unit: per mil)
    VARIABLE 2: 'TXMONANA'
    Type of variable: text
    Processing by: customer exit
    Variable entry is: mandatory
    Ready for input?  NO
    Dimension ID: Price  (currency: Argentine pesos / Unit: per mil)
    I pretend tu use the value of 'MONTOANA' in the variable 'TXMONANA', so I wrote the following code in transaction CMOD (enhancment EXIT_SAPLRRS0_001, include ZXRSRU01):
    CASE i_vnam.
    WHEN `TXMONANA`.
        IF i_step = 2. "after the popup
          LOOP AT i_t_var_range INTO loc_var_range
            WHERE vnam = 'MONTOANA'.
            CLEAR l_s_range.
            l_s_range-opt = 'EQ'.
            l_s_range-sign = 'I'.
            l_s_range-low = loc_var_range-low.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    ENDCASE.
    I'm not getting any result for the text variable.  Could you kindly help me?
    Thanks to all in advance!!!
    LL

    We found the solution with members of our ABAP team.  In the end the issue was due to the type of the field.  The field loc_var_range-low is CHAR 60 so I had to extract the first characters on the right to get the value I wanted to deliver into the text variable.
    Thanks anyway for your help.  Regards, Leticia

Maybe you are looking for

  • List of tax code in "invoice " tab in PO

    hi frends...i wanna see the list of the tax code defined for the Service PO in its "invoice" tab.like for service tax we have three tax : s1: service tax:10.3% s2: service tax:10.3% s3:service tax:10.3% now in the configuration paart i wanna see out

  • Use same external drive for 2 computers

    On my desk top I use an external hard drive to store my pictures. It is named local disk (m:). I want to work on pictures with my laptop, but when I connect external drive to laptop, is named local disk (f:). LR does not recognize this drive. I want

  • I havent had itunes for a month because...

    itunes wont open EVEN when itunes AND quicktime are installed and updated! it pops up with something that says "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience." im really getting mad because i keep installing

  • 21" studio display CRT: USB works?

    Hi can anyone confirm that the USB hub on the 21" studio display (CRT) works with OS X/a powermac G5? Thanks for your help. 12 iBook G4 1Ghz   Mac OS X (10.4.5)   soon to purchase a powermac G5

  • How to read XML by item name

    We have a XML config file as attachement. It has many jobs' configuration in it(<Job>). For every job, therer will be a item of <JobActive> with value of Y or N. Sometimes, we need to toggle the Y or N for some certain jobs. I tried to read the <JobN