HANA, Aggregations and calculating percentages

I have a table containing user-role assignments, e.g. the table contains tuples of the form (userA, roleA), (userA, roleB). Now, I would like to get an overview on how the distribution of users across roles. I would like to get the following overview.
role
COUNT DISTINCT user
percentage
roleA
5
5/15 * 100 = 33,3 %
roleB
8
53,3 %
roleC
10
66,6 %
Total
15
Using SAP HANA Studio, I created a Calculated View and count the number of distinct users with a counter. However, how to compute the totals (note that this is not the sum of distinct users per role) and how to compute then the percentages?
Thanks!

OK, totals are now computed by modeling the following two aggregations:
1. count distinct users per role
2. count distinct users in the table
Then the two aggregations are joined.
A new problem pops-up: I divide the two different counts in a calculated column or calculated attribute. Whatever I try, the result of dividing two integers is 0. What should I do?

Similar Messages

  • Difference between  aggregation and calculation tab in BEx Query Designer

    HI,
    I am using BEx Query Designer for my report, for the key figures in the coloumn area i slected one numeric key figures, in  the properties tab i found aggregation tab and calculation tab.
    I need to sum up the total values for that particualar coloumn, when i used calculation tab i found to sum all the values for a particular coloumn, then what is the use the aggreagation tab?
    I not able to used that Aggregation tab it is showing as a hidden fields...
    can any one tell me whats the exact difference between these tabs and when we need to use which tab?
    With Regards,
    Thanesh Kumar.

    Hi Thanesh Kumar,
    I moved this thread from forum Data Warehousing to Business Explorer since it is a query related question (as SDN moderator).
    I could explain to you the difference between these two tabs.
    For "calculation" tab, it changes the display of result and does not change the calculation logic.
    It means that, if this key figure is used further in formula, still the original number (without "calculation" tab setting)  is used for further formula calculation.
    For "aggregation" tab, it changes the real calculation logic.
    The system takes the setting as the aggregation rule for records.
    The most common aggregation rule is of course summation. If you set to e.g. Average here, the system does the
    Average instead of summation when aggregating records. And the Average value will be taken for calculation
    in further formulas or other calculations.
    For "aggregation" tab, you could only use it for CKF (calculated key figure) or formula and you could not use it for
    a basic key figure. That should be the reason why you see it greyed-out.
    Regards,
    Patricia

  • Exception aggregation for calculated key figure

    Is it possible to have exception aggregation for calculated key figure in BW 3.5? As per Note 1151857, it is possible, however this note applies to BI 7.0.
    As per note 152638, it is possible in older version only simple ckfs like 'CKF = Base key figure'.
    Is there any workaround to define exception aggregation for complex CKFs in BW 3.5?
    My requirement is like this -
    CKF = (sales quantity - forecast) %share (sales quantity).
    Aggregation for CKF over time should be sum whereas, for all other characteristics calculation of CKF should be done after aggregation(normal scenario).
    So, defining exception aggregation of CKF as 'Summation' over time should fulfil my requirement.
    I can not use calculate result as 'summation' setting for CKF because of following design of report.
    Report contains structure(characteristic)
    Elements of structure are -
    Last 3 months(April - June)
    Last 3 months - 1 (Mar - May)
    Last 3 months - 2 (Feb - Apr)
    and so on...
    When data is aggregated for each element of structure, base KFs will be aggregated and calculations will be done on that.
    Changes in the backend are also not possible because, normal aggregation of CKF-alike in backend will be summation for all characteristics.
    Is there any way in BW 3.5 to model such a scenario?
    Thanks and Regards,
    Anup Kulkarni

    Sum of individual values of CKFs is not same as the Calculation on 'sum of basic key figures(result of basic key figures)'.  - Yes, you are right.
    I need to aggregate CKF over time as SUM. However, calculation for result of all other characteristics should be based on results of basic key figures and not the 'Sum of individual values of CKF'.  -
    What i understood is that whenever the time char is in row, then result should be simple on the sum what ur getting but when other char are there then it should go for calculation based on the sum of key figure.
    If im not wrong in getting ur point.
    How can two differenct activites be perofrmed on same key figure depending on the characteristic .....!. For this u have to think some other possibility or let somebody else update the thread.

  • How to Transport Hana Studio developments Calculation, Atribute and Analytc View ?

    Hi Gurus,
    How toTransport developments DEV -> QAS -> PRD in Hana Studio for Analytc, Atribute and Calculation View ?
    thaks !

    HI Rogerio vaz de souza
    delivery units are the method of transport which authenticate the import/export process. Example: You should assign packages to delivery units and then all package content is exported and imported into the target system .
    More information follow below link
    SAP HANA Transport Best Practices

  • Calculated Percentage Columns in Pivot Table loose formating in Excel

    I have a simple report built using pivot table ( OBIEE 11.1.1.5.0)
    1 Metric and 1 dimension using pivot table. and I duplicated the metric column and change it to % column.(Show data as % of column). SO far so good. Below is the snapshot
    http://tinypic.com/r/2s14xa9/7
    Now i download the report in excel and all the % values are messed up . Below is how it looks
    http://tinypic.com/r/bede90/7
    I tried messing with data formats etc..nothing works.. I cannot add a custom column format to the metric column since it will impact the derived % column.
    Is this a bug ?Any pointers ..
    Thanks

    Hi,
    Follow up this SR:
    SR 3-5060435331: Calculated Percentage Columns in Pivot Table loose formating in Excel
    Workaround: (not sure may be give a try)
    also give a try like below one then try to download it may work.
    In that % column -->add the below statement in the Custom CSS section of the column properties:
    mso-number-format:"\@"
    Refer snapshot here:
    http://i53.tinypic.com/a09kqv.jpg
    This will treat the data in the column as text while downloading to excel, hence retaining any leading or trailing spaces.
    Thanks
    Deva

  • Creating Logic and modeling for SAP BW datasource in SAP HANA views and SLT

    Hi to all,
    I have small question.
    We have BW system and SAP ECC as source system and to get data from SAP ECC source system we are using SAP ECC Standard data source.
    Now we required to, create modeling in SAP HANA by use of HANA View and get data from SAP ECC source table via SLT.
    So we can replicate same modeling,as we done in SAP BW system.
    But  my question is that, as SAP ECC standard data source hit multiple table and do run-time calculation, before sending to SAP BI.
    How we can derives such calculation and logic, in our HANA studio, because as we know in SLT data transformation can be done in limited way also
    in view we can not drive such logic via SQL script ?.
    Is there any way we can do such modeling and logic in SAP HANA ?
    or
    is there any standard document for this type of case, which we can use ?
    Note: We don't want to use SAP DS or DXC for data loading to HANA, as  we want it in more real time.
    Regards
    Pavneet Rana

    Thanks for reply,
    As SLT is based on ABAP, so we can write complex logic in it.
    But if we talk about SAP ECC standard data source, they have complex logic, based on multiple table.
    So we need to write code from scratch in SLT to derive same result. but it will be huge time consuming , and required good ABAP skills, also it will lead to bug in code.
    Also it will reduce the real time performance of SLT, due to complex logic.
    Second option is procedure via SQL script, which is again huge effort in term if logic and can lead to error/bug in logic.
    Does we have any other way or architecture to do this is very simple way, with high performance and less error issue.
    Regards
    Pavneet Rana

  • Nested aggregation and additional sql in query

    Hi experts,
    I need to create a measure in the rpd that will look like:
    measure 1 = SUM(count distinct (ID)) over(order by T11687.MON_CODE asc rows unbounded preceding)
    Is it possible to have a nested aggregation and the over (...) in the query that willl be generated?
    NB: I can't use the evaluate function
    because measure 1 will be just a factor in a complex calculation where other measures are derived from different tables.
    Regards

    In doesn't work that way.
    this query is a bit "stupid", but try this
    select * from topping where topping_id = 1
    union all
    select * from topping where topping_id = 1
    union all
    select * from topping where topping_id = 1Or better yet, let it return once, and then do
    var = rs.getString(1);
    var2 = var;
    var3 = var;

  • Choosing the average of a KF in BEX at aggregation or calculations?

    Hi All,
    we have a problem in reporting due to KF that are "average" in our planning area in SAP APO but not average as Infobject.
    due to this most reports have completely wrong values.
    most of our infoobject KF are Quantity, and SUM like aggregation and Summation like Exception Aggregat.
    what should we do in this case?
    should we change the KF Exception Aggregat. to Average and this fix the problem? i saw that we have 4 types of average.
    if we change the Exception Aggregat. of our KF should we before move the KF from all the cube? or we can do the change without problem?
    if we want to fix this at BEX side, where should we decide the average? at aggregation tab or at calculations type?
    what are differences between these 2 options?
    Thanks
    Bilal

    Hi,
    As I understood you have Key Figure display in Planning Area as average and you want to replicate the same in report.
    Noramaly Key Figures are saved as normal quantities not as average so you should not change the exsiting structure.
    there are various option as you saind for your requirement.
    The priority or approach should be as following.
    Try to change at Formula level at calculation type (As in exception aggrigation you may provide one refence charcteristics and as I assume that is not your need so go for calcultion type).
    If this doesn't work then go for basi Kasic Key figure diaply proeprties change and still not able to find your results then go for Key Figure definitions change at Info object level. If you do that then movement of cube is required so try to avoid that.
    I hope this approach will work.
    Thanks,
    S

  • Difference between Before aggregation and After aggregation

    Hello ,
       Can any one tell me what is d difference between Before and after aggregation of calculated key figure?
          Thanks,
    Aparna

    Before aggregation calculates the data before summarizing the final results while after aggregation, it will summarize the result first before it calculates.
    Assume:
    Customer#----
    Orders
    10000----
    10
    10001----
    20
    10000----
    30
    if you want to count the number of customers before aggregates and after aggregates gives you different result.
    Before aggregates will give you
    Customer#----
    Count
    10000----
    2
    10001----
    1
    After Aggregates will give you
    Customer#----
    Count
    100000----
    1
    100001----
    1
    Customer might not be a good example but the concept remains the same for others.
    thanks.
    Wond

  • How to connect an non-hana-ewm with an Hana-ECC and vice versa

    Hello,
    for our migration project planning I am wondering how to connect EWM on SAP with ECC on Hana and vice versa.
    As it is, both systems are (productive) on non - hana with actual SAP-Release and have to be migrated.
    The background of my question: we may be not able do the "big bang" thing to migrate ERP ECC607 and EWM (with special Add-Ons) at one point to Hana (DMO) and therefore may need an interim solution. I checked ETL and LTS as "connectors" but they - from my point of view -  are one-way solutions from EWM to ECC/Hana -not bidirectional.I Found some questions concerning the same theme in the net but no solution at all till now..
    How about BODS ? (Didnt work with it yet)
    Best regards,
       Ronald

    Great. So I have to either install OS X, or buy a new mcahine. Can OS X run on a G3 without grinding to a halt?
    By the way, I cannot get the iPod to even mount when connected via firewire. The USB/firewire PCMCIA card does not have drivers for OS 9. I thought that this support was built into OS 9. The USB port works (although the iPod will not mount when connected via USB either). Any ideas?
    Thanks

  • Hello.  I recently pieced together a late 2008 MacBook Pro 15".  Everything works fine except the battery constantly goes between "not charging" and "calculating" or, rarely "charging". It does charge after a long while and will report that it is charged.

    Hello.  I recently pieced together a late 2008 MacBook Pro 15".  Everything works fine except the battery constantly goes between "not charging" and "calculating" or, rarely "charging". It does charge after a long while and will report that it is charged.
    I have reset the NVRAM and the SMC a couple of time but that didn't work so I ran an Apple Hardware Test and while testing the logic board it gives the following error:
    4SNS/1/40000000 LB1T
    I've done some research and found this is a temperature sensor related to the battery, but cannot find where the sensor is located in the computer.  Would you know how I can find the sensor to test it?  Could my battery problem be related to something else?  Would a fresh install of Lion help?
    Thank you!
    Mike
    Two pieces of information that may or may not b helpful, the hard drive is from my early 2008 MBP and the only test disc I have access to is from an iMac.

    Why do you have LION installed on that older machine?
    So you say you built a macbook from a bucket of parts eh?   Kudos
    heres a pic of the battery temp sensor

  • What is the best Practice to improve MDIS performance in setting up file aggregation and chunk size

    Hello Experts,
    in our project we have planned to do some parameter change to improve the MDIS performance and want to know the best practice in setting up file aggregation and chunk size when we importing large numbers of small files(one file contains one record and each file size would be 2 to 3KB) through automatic import process,
    below is the current setting in production:-
    Chunk Size=2000
    No. Of Chunks Processed In Parallel=40
    file aggregation-5
    Records Per Minute processed-37
    and we made the below setting in Development system:-
    Chunk Size=70000
    No. Of Chunks Processed In Parallel=40
    file aggregation-25
    Records Per Minute processed-111
    after making the above changes import process improved but we want to get expert opinion making these changes in production because there is huge number different between what is there in prod and what change we made in Dev.
    thanks in advance,
    Regards
    Ajay

    Hi Ajay,
    The SAP default values are as below
    Chunk Size=50000
    No of Chunks processed in parallel = 5
    File aggregation: Depends  largely on the data , if you have one or 2 records being sent at a time then it is better to cluster them together and send it at one shot , instead of sending the one record at a time.
    Records per minute Processed - Same as above
    Regards,
    Vag Vignesh Shenoy

  • I want to get increment only amount and its percentage of increment from HR

    Dear Sir,
    I want to get increment only amount and its percentage of increment can you plz help me how to get it
    please find below mentioned query.
    Regards
    select
    papf.employee_number as employee_number,
    papf.last_name as last_name,
    papf.middle_names as middle_name,
    papf.first_name as first_name,
    papf.known_as as preferred_name,
    ppt.user_person_type as employment_type,
    ppp.change_date as change_effective_date,
    cur.currency_code as currency,
    ppp.proposed_salary_n * per_saladmin_utility.get_annualization_factor(paaf.assignment_id , to_date(sysdate)) as current_salary_annual,ppp.proposed_salary_n,
    per_saladmin_utility.get_previous_salary(paaf.assignment_id,ppp.PAY_PROPOSAL_ID) PREVIOUS_SAL,
    ppp.proposal_reason as sal_proposla_resaon,
    ppp.attribute2 as performance,
    ppp.attribute3 as gandac,
    ppp.attribute4 as NINEBOXPOSITION,
    ppp.attribute1 as RPR
    from
    per_all_people_f papf,
    per_all_assignments_f paaf,
    per_pay_proposals ppp,
    per_pay_bases ppb ,
    pay_input_values_f piv,
    pay_element_types_f pet,
    fnd_currencies_tl cur,
    per_person_type_usages_f pptu,
    per_person_types ppt
    where 1=1
    and papf.employee_number in (127)
    --and ppp.change_date >= ’01-Jan-2005?
    and papf.current_employee_flag = 'Y'
    and sysdate between papf.effective_start_date and papf.effective_end_date
    and papf.person_id = paaf.person_id
    and sysdate between paaf.effective_start_date and paaf.effective_end_date
    and paaf.assignment_id = ppp.assignment_id
    and paaf.pay_basis_id = ppb.pay_basis_id
    and ppb.input_value_id = piv.input_value_id
    and piv.element_type_id = pet.element_type_id
    and pet.input_currency_code = cur.currency_code
    and papf.person_id = pptu.person_id
    and pptu.person_type_id = ppt.person_type_id
    order by papf.employee_number, ppp.change_date desc
    Edited by: user10941925 on Jan 20, 2012 2:37 AM

    Maybe (taking it literally)
    select proposed_salary_n - PREVIOUS_SAL increment,
           100 * (proposed_salary_n / PREVIOUS_SAL - 1) increment_percentage
      from (select papf.employee_number as employee_number,
                   papf.last_name as last_name,
                   papf.middle_names as middle_name,
                   papf.first_name as first_name,
                   papf.known_as as preferred_name,
                   ppt.user_person_type as employment_type,
                   ppp.change_date as change_effective_date,
                   cur.currency_code as currency,
                   ppp.proposed_salary_n * per_saladmin_utility.get_annualization_factor(paaf.assignment_id,to_date(sysdate)) as current_salary_annual,
                   ppp.proposed_salary_n,
                   per_saladmin_utility.get_previous_salary(paaf.assignment_id,ppp.PAY_PROPOSAL_ID) PREVIOUS_SAL,
                   ppp.proposal_reason as sal_proposla_resaon,
                   ppp.attribute2 as performance,
                   ppp.attribute3 as gandac,
                   ppp.attribute4 as NINEBOXPOSITION,
                   ppp.attribute1 as RPR
              from per_all_people_f papf,
                   per_all_assignments_f paaf,
                   per_pay_proposals ppp,
                   per_pay_bases ppb,
                   pay_input_values_f piv,
                   pay_element_types_f pet,
                   fnd_currencies_tl cur,
                   per_person_type_usages_f pptu,
                   per_person_types ppt
             where 1=1
               and papf.employee_number in (127)
    --         and ppp.change_date >= ’01-Jan-2005?
               and papf.current_employee_flag = 'Y'
               and sysdate between papf.effective_start_date and papf.effective_end_date
               and papf.person_id = paaf.person_id
               and sysdate between paaf.effective_start_date and paaf.effective_end_date
               and paaf.assignment_id = ppp.assignment_id
               and paaf.pay_basis_id = ppb.pay_basis_id
               and ppb.input_value_id = piv.input_value_id
               and piv.element_type_id = pet.element_type_id
               and pet.input_currency_code = cur.currency_code
               and papf.person_id = pptu.person_id
               and pptu.person_type_id = ppt.person_type_id
             order by papf.employee_number,ppp.change_date desc
    order by employee_number,change_effective_date descRegards
    Etbin

  • I just did something on my mac and now the date, time and battery percentage are in arabic and it says lebanon (arabic) in the language and text preference, how can i change it back to english? ps: i'm hopeless.

    i just did something on my mac and now the date, time and battery percentage are in arabic and it says lebanon (arabic) in the language and text preference, how can i change it back to english?
    ps: i'm hopeless.

    So what you want is for it to say Lebanon (English)?  If so, see if this helps:
    http://m10lmac.blogspot.com/2012/05/fixing-custom-english-region-settings.html

  • Sql query with conditions and calculations???

    Hi,
    how I can build a query with conditions and calculations?
    E.g. I've got this table
    Start          | End     |     Working Place     |     Mandatory
    01-JAN-13 | 11-JAN-13 |     Office           |          1
    14-JAN-13 | 25-JAN-13 |     Home Office      |     0
    04-MRZ-13| 15-MRZ-13 |     Office           |          0
    11-FEB-13 | 22-FEB-13 |     Office           |          1
    Now if column working place=Office and column mandatory=0
    the new column "price" has to calculate: (End-Start)* $25.00
    and if working place=Office and column mandatory=1
    the "price" column has to calculate: (End-Start)* $20.60
    else $0.00
    I tried it with the case statement but I didn't know how
    to calculate my values and display it to the virtual column "price".
    Something like
    case
    when Working_Place = 'Office' and Mandatory=1
         then ...
    else '0.00'
    end as PRICE
    Or is it not possible?
    Edited by: DB2000 on 12.03.2013 05:09

    Use CASE:
    select  start_dt,
            end_dt,
            working_place,
            mandatory,
            case
              when working_place = 'Office' and mandatory = 0 then (end_dt - start_dt) * 25
              when working_place = 'Office' and mandatory = 1 then (end_dt - start_dt) * 20.60
              else 0
            end price
      from  tbl
    START_DT  END_DT    WORKING_PLA  MANDATORY      PRICE
    01-JAN-13 11-JAN-13 Office               1        206
    14-JAN-13 25-JAN-13 Home Office          0          0
    04-MAR-13 15-MAR-13 Office               0        275
    11-FEB-13 22-FEB-13 Office               1      226.6
    SQL> SY.

Maybe you are looking for

  • Freezes when Ipod is connected???

    I purchased a 60gb Ipod last night because my old Mp3 player kicked the bucket. Well, I installed Itunes and everything went fairly smoothly. Itunes runs whenever I open it and it finds all my files just fine but whenever I connect my ipod to the com

  • Supplier Conversion - Sites data - Country code

    Hi, While doing Supplier conversion from release 11.5.10 to R12.1.3, we see the below value in REJECT_LOOKUP_CODE column of the AP.AP_SUPPLIER_INT_REJECTIONS table: 'AP_NULL_COUNTRY_NAME' As I understand this looks like the program is looking for a C

  • Gnu/linux on T61p?

    Dear forum members, Greetings from lands far away :-) I am in the market for a laptop, "specifically" for scientific computing - data processing, running numerical models, coding and visualization (Python, openGL, Tcl/Tk, Vis5d). I have decided to tr

  • [InD. CS5 Server][JS] XML-Import, how to receive data?

    Hello everybody! I tried to import an simple XML with the ExtendScript Toolkit on InDesign CS5 Server with the following script: var myXmlFile = new File("../path/blubb.xml"); var myContent; myXmlFile.open("r", undefined, undefined); while(!myXmlFile

  • BT Gears up 300Mbps Broadband

    Whatever next lol, bet it will come at a price lol http://crave.cnet.co.uk/software/bt-gears-up-300mbps-broadband-super-fast-home-hub-5-50011677/ iechyd da sky twitter account a customer ask why sky go streams are worst then sd and yet bt and eurospo