Formula in Query Designer

Hi Experts,
I am confused in calculating
Total sales/ net sales in bex query designer
can you help me
Regards,
Anil Doddi

Hi,
if u need to create formula in BEx first u need to create structure. any section column or Row right click on it and create structure, then right click on structure and add formula, in which u can select the chara or kf on which u wanna create formula.
hope this helps.
KS

Similar Messages

  • Unable to write a formula in query designer

    Hi Experts,
    while writing a formula in query designer in development system there is an error.
    Formula is:
    Grand total =1
    when i write in the rows it is throwing the sytax error like " General syntax error in formula"
    But the same formula has been written in production( this query is not available in development so that i am designing the same query in the development system).
    some one give me an idea.
    Thanks

    Hi,
    As i checked with implementation team and they have written the formula it has been assigned like Grand Total = 1.
    i.e. Grand Total assign to 1.(But it is not Grand Total == 1).
    Thanks for your support.
    Thx
    Edited by: satya prasad on Apr 27, 2010 7:44 AM

  • Technical name for formula in query designer

    Hi,
    We have created some formulas in Query Designer.
    We tried to assign the technical names to these existing formulas, it goes away as the save button on the top of the pop up is disabled.
    Is there a way to assign technical names of the formulas created in the query designer.
    Regards,
    Charu

    Charu Pandey,
    Formulas are local, means available for particular queries only. No technical name.
    Create Calculated keyfigures instead of formulas..., so you can save with technical names.
    To display technical name in query, give discription same as technical name.
    Hope it Helps
    Srini

  • What is the Count function in formula of Query Design?

    What is the Count function in formula of Query Design?  Could someone gives an example?
    Thanks!

    Example :
    COUNT of
    Also, check :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af

  • Value input for screen and to apply it to formula in Query Designer

    Hi Gurus !
    How could i input an value for screen in BEx and soon to apply it to formulas resident in cells in Query Designer, the result must be appear for each cell in the report.
    Thank You for your helps.

    create a variable with Manual/user input option.
    use its value to populate the calculated field.

  • Units for formula on  Query Designer

    Hello,
    how can show a specific unit for a value calculated as a formula on a query ?
    thx in advance
    cheers

    Hi Juan,
    Could you please give more details...what is the original unit and what do you want it to be...

  • Output a text value from formula in query designer

    I need to display different text values in a query. For example, if actual delivery date falls within 5 days of planned delivery date, display 'ON-TIME'; if earlier than 5 days display 'EARLY', if later than 5 days display 'LATE', etc. I've been researching this to death. Does it have to be a customer exit variable or is there a better way to do this?
    thanks!

    Hello Jill,
    Yes creating three CKF's was correct and those will output a 1 if your condition satisfies else a zero. Create a new formulae and use a the  CKF's that you created and multiply with 2,3,4.
    Example : Formulae Description "Early=2" ,"Late =3","Ontime=4"
    Then your logic is "ckf12 + ckf23 + ckf3*4" which means only one will be true per line so it will result in either 2 or 3 or 4.You will see
    Delivery Date       Scheduled Date   "Early=2" ,"Late =3","Ontime=4"    
    12/20/2007            12/24/2007                          2
    12/22/2007            12/21/2007                          3  
    You will have to create a Text Variable with Customer Exit option which will say if output of  example Tech name of "Early=2" ,"Late =3","Ontime=4" is "ZEar_Lat_Otime"
    When "ZEar_Lat_Otime"
       if     Result= 2 then "Early",
       if     Result =3 then "Late"
      else  Result =4 then "Ontime"
      into   "Text_Variable"
    code to be some thing like that.
    Result Display:
    Delivery Date       Scheduled Date   "Early=2" ,"Late =3","Ontime=4"    
    12/20/2007            12/24/2007                          Early
    12/22/2007            12/21/2007                        Late
    Show your client the below result and see if he is OK with the result then you dont have to use Customer Exit.
    Delivery Date       Scheduled Date   "Early=2" ,"Late =3","Ontime=4"    
    12/20/2007            12/24/2007                          2
    12/22/2007            12/21/2007                          3

  • IF Formula in Query Designer for Reporting Master Data?

    Hi,
    i am trying to realize the following function.
    I want to display Master Data characteristics in a Query
    The Formla is:
    Display Characteristic of InfoObject 1 IF Characterristic of InfoObject 2 equals Characteristic InfoObject 3
    thx in advance!
    Dominik

    Hi,
    Comparing the characteristics can be done by using <b>replacement path variable</b>.
    Please find the below link about using replacement path variables to compare two date characteristics.
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
    hope this helps.
    regards,
    Pruthvi R

  • Blank space in Query Designer formula

    Hello
    I am using a formula in query designer to make some calculation but, once executed, this formula shows a blank space.
    What does a blank space means?? The formula is not giving me an error.
    Thank you,
    Skull

    Hi,
    I think the blank appears in the report because it is encountering a Divide by Zero error.
    First check what calculations your doing in the formula. If your doing a division and if there are chances that the Denominator is 0 and numerator has some value, then based on the setting in the spro, you might get a blank.
    Try and put the function in BEx that handles divide by zero errors. The function is NDIV0
    If that is not the case then please paste the formula that you have written.
    Regards,
    Forum

  • Formula creation in Query designer

    Hi All
    I want to explain a bit more on my requirement .
    I have supplied qty and ordered qty and i have the difference between both which is called as service level as %. there will always be 100% for some suppliers and lessthan 100% . So i want to count only the 100% suppliers and divide by all the suppliers . so that i can get the perfect order . and the formula is below .
    I need to apply a formula line count with 100% / line count in one of my querys how to do it the qury designer . Can you anybody guide how to do it .
    Thanks in advance . I am sorry if i have posted in the worng fourm .
    thanks

    you must be having an  infobject refering to say supplier say supplier no. ( like customer number).
    STEP 1: create a new CKF ( formula in query designer on right columns panel)
    STEP 2: create a formula variable with reference characteristic as supplier no . replacement path replaced with infobject->attribute value - constant 1.
    STEP 3. you CKF  " NO OF SUPPLIERS"  definition would be as below
    supplier counter .
    STEP 4. identifying 100% suppliers.create a new CKF  " NO OF 100% SUPPLIER " ( formula in query designer on right columns panel).
    it definition would be
    supplier counter * ( ordered qty == supplied qty ).
    where supplier counter is formula variable. this will give total counts of supplier where ordered qty == supplied qty.
    STEP 4.
    divide CKF  " NO OF 100% SUPPLIER " / " NO OF SUPPLIERS"

  • Error in formula(query designer)

    Hi guys,
    I have a formula in query designer.Its showing wrong value.Cannot understand why?
    Formula:
    (-1) * (Actual.present month < Actual previous month) + 1 * ( Actual present month >= Actual previous month )
    Actual present month and Actual previous month both are selections and are also shown in query.Eevnthough,Actual Present month is equal to Actual previous month,result is showing -1.
    I checked Sign settings in Formula properties but they have right settings for 'Keep +/- sign' as it is chosen.Exception aggregation is chosen as Total.I tested by changing it to standard aggregation but its the same.
    Is there any setting I need to change.
    Thanks for your help.

    Hi ravi,
    It didnot solve the problem.In my case ..  its working for all other company codes but failing only for this company code and that too from Januari this year....
    To other authors:
    Thanks for your replies.This is existing in our Production query and for this month,it started showing wrong value...for febraury,actual month value is equal to actual previous month(January)..so it should show 1 but its showing -1. so we noticed.I havent changed anything to log out and log in and check.Also,the result should be 1,-1...so I cannot use max funtion as mentioned by Jaya.
    Any different ideas of achieving this are welcome.

  • Where to write IF THEN ELASE statements in BEX Query Designer

    Hi All,
    I need to write a formula in query designer...
    saying that to display the all Quantities in KGs.. Now articles are in Grams and KGs...
    So here i need to perform calculation like... if article is in KGs divide by 1, else if article is in Grams divide by 1000.
    where can i write this logic to perform calculation ...
    Thanks in advance..
    ravi.p

    hi chetan,
    No its not work.. why because i  need to convert the unit of measure in Masterdata Attribute values... that means ) ' 0grooss_wt'.  this is  attribute as a keyfigure of ' 0material' .. this ' 0gross_wt' values has to convert in KGs. at Present ' 0gross_wt' values are in KG and Grams...
    I can change these values in update rules by writting  Routine.. But I need to convert it in KGS at BEX Query Designer Level..
    I need calculate like this
    quantity sold * Gross Weight. 
    here Gross Weight is the formula variable which replacing the values of gross weight...
    i tried by creating conversion types in RSUOM t-code. but it works on keyfigures of infocube.. not on attribute values of master data...
    is there any solution to solve this Problem...

  • In query designer, an hierarchy(structure)  duplicating lines in level 2.

    Here we are at version 7.0 - SP 10, I have created a structure hierarchy in BEX, and when I execute this query the result is ok ... until I tried to closed or open the second level.
    At first, it doesn't close, and the worst if I tried to open  it's
    duplicating the lines of the second level.
    In query designer, creating an hierarchy(structure) something like this:
    > total division 1    
    ...> division 1.1     
    ...> division 1.2     
    > total division 2    
    ...> division 2.1     
    ...> division 2.2     
    and after the execution, if I tried to close or open the level of division 2 the result will duplicates the lines division 2.1 and division  2.2. the result is like this:
    > total division 1    
    ...> division 1.1     
    ...> division 1.2     
    > total division 2    
    ...> division 2.1     
    ...> division 2.2
    <b>...> division 2.1     
    ...> division 2.2</b>
    The stange is in excel it works normaly.
    Best regards,
    Silvio Meurer

    Hi,
    An Heirarchy is always an addition of the below nodes. hence. WBS 1 = WBS 1.1 + WBS 1.2. since youre looking at durations. it will add up 7+9 instead of looking at earliest start and latest end dates.
    dont know if itll work but a suggestion would be to get the start date and end date for WBS 1 and then do the calculation for duration in a formula in query designer.
    regards,
    Dilanke

  • Using Hierarchy in Query Designer

    Dear all
    When I use hierarchy of InfoObject 0WBS_ELEMT, there is a hierarchy which has structure following:
    WBS 1
         WBS 1.1
         WBS 1.2
    In every WBS, I focus on 3 infos (start date, finish date and duration)
    WBS 1.1 has startdate: 2/8/2010, finish date: 10/8/2010, duration: 7
    WBS 1.2 has start date: 5/8/2010, finish date: 17/8/2010, duration: 9
    As my understanding, WBS 1 is parent of WBS 1.1 and WBS 1.2, so start date of WBS 1 is 2/8/2010 and its finish date is 17/8/2010 and duration is 12 (only included working day).
    In Infocube, I received correct duration of WBS 1, but in Query Desinger, duration of WBS 1 = duration of WBS1.1 + duration WBS 1.2, This is incorrect.
    Please help me way config for duration of WBS correctly in Query Designer.
    Thanks
    DaoBX

    Hi,
    An Heirarchy is always an addition of the below nodes. hence. WBS 1 = WBS 1.1 + WBS 1.2. since youre looking at durations. it will add up 7+9 instead of looking at earliest start and latest end dates.
    dont know if itll work but a suggestion would be to get the start date and end date for WBS 1 and then do the calculation for duration in a formula in query designer.
    regards,
    Dilanke

  • Rounding the values in Query designer

    In Query Designer, I am trying to store the rounded value of the below calculations to use in calculating a difference amount and %variance.
    Currently:
    Report shows actual % of 1.1 and budgeted % of 1.1, because we are rounding the actual value of 1.0798 to 1.1 and the budgeted value of 1.1326 to 1.1.  The difference is calculated as budget u2013 actual or 1.1326 u2013 1.0798 = .0528 and the percent variance is 0.0528/1.1326 = 4.66%.
    Requested:
    The end user wants the rounded values of 1.1 used in calculating the differences and percent variance, so 1.1 u2013 1.1 = 0 difference and percent variance is 0/1.1 = 0%.
    What function can I use to recall the rounded values to use in difference and percent variance calculations?
    Thanks for any and all help!
    Kim Plut

    HI Al -
    Your suggestion:
    If you want to round a key figure "KF" to have zero decimals:
    ( FRAC ( 'KF' ) < 0.5 ) * FLOOR ( 'KF' ) + ( FRAC ( 'KF') >= 0.5 ) * CEIL ('KF')
    An equivalent MS Excel formula you can use to test is:
    =IF(A3-TRUNC(A3)<0.5,FLOOR(A3,1),CEILING(A3,1))
    If you want to round a key figure "KF" to have 2 decimals:
    ( FRAC ( 'KF'*100 ) < 0.5 ) * FLOOR ( 'KF' * 100 ) / 100 + ( FRAC ( 'KF'
    100 ) >= 0.5 ) * CEIL ('KF' * 100) / 100
    The equivalent MS Excel formula to test it is:
    =IF(A5100-TRUNC(A5100)<0.5,FLOOR(A5100,1)/100,CEILING(A5100,1)/100
    is exactly what I need, I am struggling to find the formula to round the key figure to 1 decimal in the query, any suggestions on how to modify the above formulas to return one decimal.  I was able to successfully test in Excel but cannot get the correct formula in Query designer.
    Thanks
    Kim

Maybe you are looking for