Calculate percentages in query

Hi gurus,
Me and my team are working in creating queries in BI, I have some trouble calculating some porcentge.
I want to create calculated KF that shows the following situation:
                  Revenue       Percentage of total
Material A:    10$                     33%
Material B:    20$                     66%
        Total:    30$                    100%
As you see, I want the KF to display in the query, in every material line, the percentage of the total revenue. Do you know how to calculate this percentage?
Thank you very much in advance.

Hi David
Create a new formula in the colums section of the query designer then use the "Percentage Share of Result" (%CT)
option.  This is entered as %CT "Key Figure".
In your case %CT Revenue
Hope this helps
Regards
Nick

Similar Messages

  • Calculate Percentage from the result of row result

    Expert
    I want to calculate percentage from row result
    For Ex
    Vendor
    ID  Record Percentage
    1001                                1002                   1003                                sum
    A   10   10%                     B   20   20%        C   70     70%                  100         100% 
    X    50   25%                    Y   125  62.5%      Z   25     12.5%               200          100%
    I want to get percentage such as A percentage 10/(102070), , X percentage 50/(5012525)
    not A 10/(10207050125+25) = 3.33%
    Please help me to get the percentage which client want to
    thanks

    Dear Lemine.
    Try using this..
    Percentage Share of Result (%CT)
    %CT<Operand>
    Specifies how high the percentage share is in relation to the result. The result
    means the result of aggregation at the next level (interim result).
    %CT Incoming Orders specifies the share of incoming order values of each
    individual characteristic value (for example of each customer) in relation to
    the characteristic's result (for example, customer of a division).
    Percentage Share of Overall Result (%GT)
    %GT <Operand>
    Specifies how high the percentage share is in relation to the overall result.
    The overall result means the result of aggregation at the next level in the list.
    In the calculation of the overall result, the dynamic filters (filters that were
    not already defined in the Query Designer) are included.
    Hope this helps u..
    Best Regards,
    VVenkat,,

  • Can HPCM calculate percentages to use in allocations as well as perform the allocations

    Hi All
    I have a client that is evaluating which products to purchase from the Oracle stack.  Unfortunately I don't know HPCM yet so I'm not sure of its capabilities.  I think they will definitely go with Hyperion Planning but they do some relatively simple allocations and I cannot decide whether or not they need HPCM.  They currently have a relational / access database that is used to calculate percentages to be used to allocate costs from back office to front office.  Whether they need to purchase HPCM seems to depend upon whether HPCM can calculate the percentages required for the allocation as well as perform the allocations.  The options as I see it are:
    1.  Replace legacy system with HPCM and use HPCM to calculate percentage and apply percentages to allocate costs
    2.  Keep legacy system for calculating percentages, upload percentages to HPCM and use HPCM to allocate costs
    3.  Keep legacy system for calculating percentages, upload percentages to Essbase and use Essbase to allocate costs
    4.  Keep legacy system for calculating percentages and allocating costs (not ideal as will require additional system interfaces of data from and to Hyperion Planning)
    I know HPCM uses Essbase, when I say Essbase above I mean Hyperion Planning.  I have advised the client that they ought to avoid option 4 but I am not clear enough on what HPCM can do to advise them on which of the other options is most suitable / cost effective.
    Any help would be appreciated.
    Regards
    Stu

    Hi Stu,
    the plain answer is Yes, HPCM can do such a simple task. In my private opinion, it would be a bit oversized.
    I want to add an option and put my vote on this:
    0.  Pull in a DB connection the required data into Planning and use Planning to calculate percentage and apply percentages to allocate costs.
    Regards,
    Philip Hulsebosch.
    www.trexco.nl
    p.s. To all users, close questions which were answered. Then we do not have to open them to see if we can help = saves us time to help others.

  • How to calculate percentage old school

    I am looking for a calculator aps that can calculate percentage like in the 1980 Casio calculator,
    Example:
    100 x 25% +
    That would equal 125 and not 50
    Merck

    Meg St._Clair wrote:
    By the way, 100x25% =25, not 125 or 50. What your asking is 100 + (.25x100). At least, as best I can tell.
    What you missed - and I missed it as well at first is the + sign in the OP's post which then makes the calculation...
    100 x 1.25 + = 150 where the + adds the 25 back onto the subtotal.
    100 x 1.25 = 125 + 25 = 150.
    That is how I interpret what the OP wants to do.

  • SSRS Expression to calculate percentage with the denominator being the first value in the same column group in a matrix report

    Hello, Expert,
    Could you please help me with the following problem? Thanks in advance!
    I have designed the matrix report (SSRS 2012) with database table structure looks like below.    
    Week           
    Version
         Count
    Week1
    V1.1
    4000
    Week1
    V1.2
    4000
    Week1
    V1.3
    4000
    Week2
    V1.1
    3000
    Week2
    V1.2
    3000
    Week2
    V1.3
    3000
    Week3
    V1.1
    2000
    Week3
    V1.2
    2000
    Week3
    V1.3
    2000
    Week4
    V1.1
    1000
    Week4
    V1.2
    1000
    Week4
    V1.3
    1000
    The matrix report displays like below. Column grows based on no of Week in the table.   
    Week1
    Week2
    Week3
    Week4
    V1.1
    4000
    3000
    2000
    1000
    V1.2
    4000
    3000
    2000
    1000
    V1.3
    4000
    3000
    2000
    1000
    What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
    Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!

    Heidi,
    Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
    group like this:
    Week  VersionMajor VersionMinor Count
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Week1  V1           V1.1         2000
    Week2  V1           V1.1         1500
    Week3  V1           V1.1         800
    Week1  V1           V1.2         1000
    Week2  V1           V1.2         500
    Week3  V1           V1.2         200
    Here is the query for the above data:
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
    UNION ALL
    SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
    UNION ALL
    SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
    UNION ALL
    SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
    And my matrix table looks like this:
    What I need to do is to calculate the percentage of each week over week1 for
    1) V1 Total
    2) V1.1
    3) V1.2
    I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
    First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
    Happy New Year!

  • How to calculate percentage based on key figure maximum value

    Hello everybody!
    I need your expertise on a query 'issue' I'm facing. Let's say I have a query getting me the Number of Open Items per Week (starting from billing document's Issue Date).
    My client wants to be able to see the percentage per week and not the actual number.
    So, what I have is below:
    <b>Wk</b><b>"OI Nr"</b>
    1                                "68.801"
    2                                "66.288"
    3                                "59.344"
    4                                "50.506"
    5                                "20.950"
    And what I want is below (in italics):
    <b>Wk</b><b><i>"OI %"</i></b>
    1                       "<i>100%   </i>"           (i.e. 68.801 / 68.801 * 100)
    2                      "<i> 96,34%  </i>"         (i.e. 66.288 / 68.801 * 100)
    3                      "<i> 86,25%  </i>"         (i.e. 59.344 / 68.801 * 100)
    4                       ......
    5                       ......
    Is it possible to achieve sth like this by altering some key figure properties or in any other way?
    Thanks in advance.

    First u need to create a calculated Key Fig globally. You can do this at the extreme left end of the query Designer. Just right click on the Calculated key Fig and say <b>New Calculated Key Figure</b>
    Give the description of the Key Fig and in the formula section just put the the key fig . <b>'OI Nr'</b> in you case
    When u say ok it will open the properties of the key fig there u can see <b>Enhance>></b> at the bottom. Click on that make the <b>exception aggregation</b> to <b>maximum</b> and <b>refernce characteristic</b> for the one which u are having the values 68.801, 66.288, 59.344, ..
    Save this calculated key fig
    now in the Columns create a <b>new selection</b> under the key fig.
    drag the newly created calculated key fig in this <b>new selection</b> and say ok.
    Now right click on this <b>new selection</b>, go to the <b>Calculated Single Value</b> as drop down and make it <b>Normalize-Sub Totals</b>
    Tick the checkbox  <b>Also Apply to result</b>
    and select <b>Calculate Along Columns</b>.
    Save the query and execute. This should solve youe issue
    Hope this helps.

  • How to calculate percentage growth rate

    Hi guys,
    Please I am trying to calculate the percentage of growth rate using MDX query.
    I have tried this but it keeps returns a null value.
    Create Member CurrentCube.[Measures].[Monthly Growth Internet Sales Amount]
    As [Measures].[Internet
    Sales Amount]/
    ([Date].[Month of Year].CurrentMember,[Measures].[Internet Sales Amount])- 
    ([Date].[Month of Year].PrevMember,[Measures].[Internet Sales Amount]), 
    FORMAT_STRING = "Currency", 
    VISIBLE = 1
    I need your assistance please.
    me

    Are you trying to return a percentage? If so, your format_string needs to have a percentage format.
    Also, are you trying to return [Internet Sales Amount] change vs last month? 
    If so, the query should be something like this...
    Member CurrentCube.[Measures].[Monthly Growth Internet Sales Amount]
    As
    (([Date].[Month of Year].CurrentMember,[Measures].[Internet Sales Amount])-
    ([Date].[Month of Year].PrevMember,[Measures].[Internet Sales Amount]))
    / [Measures].[Internet Sales Amount],
    FORMAT_STRING = "0.0%",
    VISIBLE = 1
    Please mark as answered, if this is what you are looking for.

  • How to calculate aging iin query desiner in bi7.0

    Hi all,
    can any help me how to write a formula in bex  QUERY desiner bi7.0
    acullay i have service order creation date in my cube ERDAT and
    business requirements is calculate the aging
    i want to minus the current date with creation date and i need the result in DAYS
    i am new to BI .
    Regards,
    Raja

    Why ask same question again ????
    How to write a formula in BEX in bi7.0
    Create a formula variable of replacement path on service order creation date say ZSCRE
    Create a customer exit variable and populate sy-datum into it in the user exit of CMOD say ZSYDAT
    or
    There is one standard variable available as key date in BEX you can use that too.
    Create a formula or CKF  :
    Age days = ZSYDAT - ZSCRE.
    Hope this helps.
    Edited by: Praveen G on Sep 15, 2008 5:14 AM

  • Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008

    I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
    row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the  grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
    report.

    Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
    So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
    "=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
    /IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
    Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
    Thanks.
    If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Calculate percentage based on checkbox results in Numbers iOS

    Using Numbers iOS, I've created a gradebook to keep track of my students' progress.
    I have used the Checkbox format for my results, and I would like to create a formula that will calculate a percentage based off of the checked results.
    What formula could I use to convert the TRUE and FALSE results from my checkbox cells into 1s and 0s, add up the score, and then convert the total score into a percentage?
    I've attached a picture to help explain what it is I'm trying to do here. I'd like to keep the checkboxes cells as checkboxes and only have the results converted in the "Grade" Column.
    Thanks for your help!

    Hi joey,
    Here is an approach. The screenshot is from OSX but the formula should work well for you.
    The formula in F1 =COUNTIF(A1:E1,TRUE())÷5
    My reporting cell is formatted as %.
    quinn

  • How to calculate percentage of errors in DP

    Hi Gurus,
                 Can anyone tell me How to calculate the percentage of errors? 
    I had generated forecast and wanted to know how much is the error we have .
    Please let me know your answers
    Thanks a Lot
    regards,
    Raj

    Hi Gurus,
                  I just wanted to know how to get lowest percentage errors for my forecast and make business happy ?
    I am using "Auto Model selection-2" and i wanted to have lowest percentage errors and what should i do for it?
    What alpha , Beta and Gamma values need to keep in forecast profile?
    Please let me know it will be really great
    Thanks for the answers
    Regards,
    raj

  • Calculate Relation within Query Results

    I am currently stuck with a Resultset which Looks as follows:
    | Month   
    | LastWeekForMonth | ValueForLastWeekOfMonth
    |
    | 2013-09
    |    
    2013-40            |     
    981408,27                  
    |
    | 2013-10
    |    
    2013-44            |     
    931209,12                  
    |
    | 2013-11
    |    
    2013-48           
    |     
    1081302,00                
    |
    | 2013-12
    |    
    2013-52           
    |     
    935418,21                  
    |
    | 2014-01
    |    
    2014-05           
    |     
    911402,11                  
    |
    | 2014-02
    |    
    2014-09           
    |     
    991201,10                  
    |
    This I Calculate using the following Query:
    SELECT C.Month
    ,RT.[Weekstamp] as LastWeekForMonth
    ,Sum([RevenueValue]) as ValueForLastWeekOfMonth
    FROM [Database].[dbo].[fact_RevenueTable] RT
    INNER JOIN CalenderWeekTable CW on RT.Weekstamp = CW.Weekstamp
    INNER JOIN CalenderTable C on CW.KalenderID = C.KalenderID
    WHERE RT.Probability <= 1
    AND RT.Weekstamp IN (
    SELECT max(CW.[Weekstamp])
    FROM [Database].[dbo].[CalenderWeekTable] CW
    INNER JOIN CalenderTable C on CW.KalenderID = C.KalenderID
    WHERE C.Month >= @FromSQLMonth and C.Month < @ToSQLMonth
    GROUP BY C.Month
    GROUP BY RT.Weekstamp,C.Month
    What i Need now is:
    | Month    | LastWeekForMonth
    | ValueForLastWeekOfMonth 
    | QuotientToPreviousMonth 
    |
    | 2013-09
    |    
    2013-40           
    |     
    981408,27                   
    |         
    1.04                       |
    | 2013-10
    |    
    2013-44           
    |     
    931209,12                   
    |    
    0.948849880794259    
    |
    | 2013-11
    |    
    2013-48            |     
    1081302,00                 
    |    
    1.161180637921587     |
    | 2013-12
    |    
    2013-52           
    |     
    935418,21                   
    |    
    0.8650850641171477   |
    | 2014-01
    |    
    2014-05           
    |     
    911402,11                   
    |    
    0.9743258151880537   |
    | 2014-02
    |    
    2014-09            |     
    991201,10                   
    |    
    1.087556292798137    
    |
    So what i Need is a new Column which would Show the Quotient between :
    ValueForLastWeekOfMonth / ValueForLastWeekOfPreviousMonth
    now the question to all of you great and always helpfull People:
    Is there a way to accomplish this in SQL ?
    Since I want to Calculate this within SQL Server (or if else, in SSIS) it means that there could be made use of all the Tools available in SQL Server 2012.
    Thanks to you all in Advance, I'm Looking Forward to Hearing from you!

    yep you could simply tweak your query as below
    ;WITH Temp_Data
    AS
    SELECT ROW_NUMBER() OVER (PARTITION BY C.Month ORDER BY REPLACE(RT.[Weekstamp],'-' ,'') * 1 ) AS Seq,
    C.Month
    ,RT.[Weekstamp] as LastWeekForMonth
    ,Sum([RevenueValue]) as ValueForLastWeekOfMonth
    FROM [Database].[dbo].[fact_RevenueTable] RT
    INNER JOIN CalenderWeekTable CW on RT.Weekstamp = CW.Weekstamp
    INNER JOIN CalenderTable C on CW.KalenderID = C.KalenderID
    WHERE RT.Probability <= 1
    AND RT.Weekstamp IN (
    SELECT max(CW.[Weekstamp])
    FROM [Database].[dbo].[CalenderWeekTable] CW
    INNER JOIN CalenderTable C on CW.KalenderID = C.KalenderID
    WHERE C.Month >= @FromSQLMonth and C.Month < @ToSQLMonth
    GROUP BY C.Month
    GROUP BY RT.Weekstamp,C.Month
    SELECT t.*,
    t.ValueForLastWeekOfMonth/NULLIF(t1.ValueForLastWeekOfMonth,0) AS QuotientToPreviousMonth
    FROM Temp t
    LEFT JOIN temp t1
    ON REPLACE(t1.[Month],'-','') * 1 = (REPLACE(t.[Month],'-','') -1)
    AND t1.Seq = t.Seq
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to calculate percentage and difference of two values in matrix report in ssrs 2008

    Hi everyone,
    DB--SQL server
    SSRS-2008
    I am creating matrix report with grouping on WEEK and Fiscalyearweek,
    I need to calculate of difference between FY14W01,FY15W01 ande  percentage of those..
    how to calculate in ssrs level.
    Thank You, Manasa.V

    Hi veerapaneni,
    According to your description, you want to calculated the increment percentage and difference between two fiscal year week within each week. Right?
    In this scenario, since we need to do calculation based on values between dynamically generated cells, we can't simply use expression to achieve this goal. In this scenario, we need to use custom code to record the value for fiscal 14 and fiscal 15, then
    we can calculate the difference and percentage within the column group. We have tested your case in our local environment, please refer to the steps and screenshots below:
    1. Add the custom code below into the report (you may need to modify the data type based on your scenario:
    Public Shared Value1 as Integer
    Public Shared Value2 as Integer
    Public Shared previous as string
    Public Shared previousweek as string
      Public Shared Function GetValue(Value as Integer,product as String,Week as String) as Integer
    If product =previous and Week =previousweek  Then
         Value2=Value
    Else
    previous=product
    previousweek=Week
    Value1=Value
    End If
         return Value
      End Function
      Public Shared Function GetPct()
         return (Value2-Value1)/Value1
      End Function
    Public Shared Function GetDiff()
         return Value2-Value1
      End Function
    2. Design the matrix like below:
    3. The result look like below:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • ALV Grid( How to calculate percentage) using alv gridfunctional module.

    Dear Gurus,
    In my report first coulmn and second column are sales and margin but third coulmn is margin%. now at last of report i want to display total sales and total margin and overall margin percentage. I am able to do total of sales and margin by using standard functionality of grid. I need to know to calculate overall percentage. I am not using alv oops method . I am using fucntional modules .
    Thanks in advance.
    Regards
    Dave

    Hi Devendra shrama,
    Percentage calculation in ALV
    The following method is a bit of a mission but it
    seems to be the only way around this at the moment.
    Also it only works with an ALV Grid not an ALV List.
    You have to take over the total lines manually.
    1. In the ALV output tab add extra fields that are the
    same as those on which you are sorting and contain the
    same values.
    2. In the Field Catalog you must add these fields but
    they must be hidden i.e. no_out = 'X'.
    3. These fields must be included in the Sort Catalog
    with subtot = 'X'.
    4. In order to handle the final total line in your
    layout for the ALV you must set field no_totalline'X' because you are going to be taking this over as
    well.
    5. Create a form called SUBTOTAL_TEXT or similar
    structured as follows:
    form subtotal_text using ep_subtot_line like
    output_tab
    es_subtottxt type
    slis_subtot_text.
    In this form you will do the percentage calculation
    again at total level. The structure ep_subtot_line
    will contain a field for each of the fields in your
    output_tab i.e. ep_subtot_line-sales,
    ep_subtot_line-cost and ep_subtot_line-margin. Put the
    margin calculation into ep_subtot_line-margin.
    6. In the eventtab that you pass to the ALV_GRID
    function module you must create a record with the
    field name = 'SUBTOTAL_TEXT' and the field form = the
    name of the form you created in step 5 above.
    This works OK.
    i hope it helps you.Happy solving.
    thanks
    karthik

  • Efficient Way to calculate percentage value

    Hi all
    I need to calculate x % of y using ABAP coding .
    I am not sure what code i can use..can anyone
    help me ?

    You can just use normal calculation, like X divide by Y times 100.  or ues the function within query. 
    Good Luck,
    CL

Maybe you are looking for