New Calculated field question. Complicated I think.

I have managed to create this table from a MySQL database:
The field 'Total' is a calculated field using this SQL query:
$query_Recordset1  = 'SELECT *, `Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE  Off`) As Total, `CPU`*`Cores` As Phys_Cores FROM `Personal_data` WHERE 1  ORDER BY (`Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`)),  `Date & Time` ASC';
So far, so good, but as you may have  noticed, there is a next field called 'Rel. Perf.' which only contains  blanks. And that is where my problems start.
The table is sorted by 'Total' and the first record shows these figures and field names that are relevant for my question:
Fields: 'Total'  'Disk I/O'  'MPEG2-DVD'   'H.264-BR'   'MPE On'   'MPE Off'
Values:  131,        67,              21,                  37,              6,              64
In addition, I use four 'weight' figures, let's say these are 0.27 , 0.30 ,  0.20 and 0.23 denoted as W1, W2, W3, W4.
First step is to calculate four temp values, using a formula like this resulting in T1, T2, T3 and T4:
T1 = W1 x  Total /Disk I/O; T2 =  W2 x Total/MPEG2-DVD ; T3 = W3 x Total/H.264-BR ; T4 = W4 x Total/(IFNULL(MPE On, MPE Off)
Note that this only applies to the top record and here the SUM(T1, T2, T3, T4) results in 131, equal to the Total.
The result of 100 x SUM(T1, T2, T3, T4)/ Total = 100 should be the 'Rel.Perf.' result for the top record.
Now  is gets difficult. Let me call the records R1, R2, R3, ..., Rx. Now, in  the previous step we have established that the figure 100 should into  R1.
For R2 the result of the 'Rel.Perf.' is 100 x SUM(T1 x Disk  I/O(2), T2 x MPEG2-DVD(2), T3 x (H.264-BR(2), T4 x (IFNULL(MPE on, MPE  Off)))/ Total(2)
For R3 the result of the 'Rel.Perf.' is 100 x  SUM(T1 x Disk I/O(3), T2 x MPEG2-DVD(3), T3 x (H.264-BR(3), T4 x  (IFNULL(MPE on, MPE Off)))/ Total(3)
etcetera for all the rest of the records in the table.
A  complicating factor is that the reference point of the top machine  should remain fixed at 100, but when doing queries, the top machine may  not be in the query results, but all the query results for the Rel.Perf.  should be derived from these scores. Life would be infinitely easier if  one would be certain that the top machine is fixed, but that is not the  case.
Sorry to make this such a long and complicated post, but  for those who have struggled through this long message, if you have any  suggestions on how to make this work, I would appreciate it.
Thanks in advance.
Harm, while non is intended.
PS. I have been trying to generate a SQL query, using the following code:
$query_Recordset1 = 'SELECT *, FORMAT(`Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`),0) As Total, FORMAT((54.661*`Disk I/O`+161.25*`MPEG2-DVD`+71.66666*`H264-BR`+645*IFNULL(`MPE On`,`MPE Off`))/129,1) As RPI,`CPU`*`Cores` As Phys_Cores FROM `Personal_data` WHERE 1 ORDER BY 54.661*`Disk I/O`+161.25*`MPEG2-DVD`+71.66666*`H264-BR`+645*IFNULL(`MPE On`,`MPE Off`), `Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`) ASC';
For static work it is OK, but not when a new top performer submits his data.

Hi William,
Per my understanding that you want to count the number of the value in the field wait which is smaller then 15, right?
I have tested on my local environment and that you can add the calculated field (Count) using the expression as below:
Insert an outside group row and then get the total count by using below expression:
Preview you will get the result like below:
If your problem stil exists, please try to provide some sample data and the exprect count result you want.
Any problem, please feel free to ask.
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • SAP HANA calculation field

    I have a query on the new calculated field in SAP HANA. What is the usage of this field, what are the pre-requisites and potential case when it is recommended to use such fields? Do we need to have a calculative view to use the calcluated field or can it be used directly in ABAP code?
    Kindly let me know. We are in the process of code optimization for HANA.
    Best Regards,

    Hey Mohit,
    can you please give a bit more details, e.g. documentation about what you refer to as "the new calculated field in SAP HANA".
    Concerning the details of usage within HANA, i.e. whether you need a calculation view etc. you might have a look at the SAP Help (Introduction - SAP HANA SQL and System Views Reference - SAP Library)) or maybe directly in the HANA SQL reference (
    From my answer I think you can directly guess, that there's no way in directly accessing the calculated field from ABAP - except of course if you access it using native SQL (ADBC or EXEC SQL).
    For code optimization in SAP HANA (from an ABAP developers perspective), you might want to have a look at our Open SAP course (ABAP Development for SAP HANA - Dr. Jasmin Gruschke and Jens Weiler) or in the documentation given in our "Get Started" Section of ABAP for SAP HANA namely ABAP for SAP HANA Reference Scenario and ABAP for SAP HANA Reference Scenario - AS ABAP 7.4 Support Packages.
    In case you need more HANA (less ABAP) related information for your question, you might additionally contact the HANA experts on SAP HANA Developer Center.

  • Intermediate time in calculation field in BAM11g

    I have two field in my data object receivedtime and endtime.Is there any way to get intermediate time in calculation field?

    I can think of implementing it like this:
    1. Create a calculated field c1 as endtime - receivedtime. This will give you c1 value as an integer which represents seconds.
    2. Create another calculated field c2 as DateAdd(receivedtime, 0, 0,0,0,0,c1/2,0). DateAdd is of this format: DateAdd(receivedtime, yy,mm,dd,hh,mm,ss,millisec)
    c2 should give you intermediate datetime value.

  • SharePoint Calculated Fields Column Question (ISBLANK)

    I have created a formula (that works) assuming all the rows have data in it..... If the date isn't entered (and there are reasons it might not be) it throws in a time before the Internet..ha10/31/1899Example:=IF([Type of Approval]="Final Plan",[Expiration Date]-60,IF([Type of Approval]="Joint Permit",[Expiration Date]-120,IF([Type of Approval]="Misc Permit",[Expiration Date]-120,IF([Type of Approval]="NPDES Permit",[Expiration Date]-120,IF([Type of Approval]="PennDOT Permit",[Expiration Date]-30,IF([Type of Approval]="Preliminary Plan",[Expiration Date]-60,IF([Type of Approval]="Zoning Approval",[Expiration Date]-90)))))))I tired about every variation I could think of to add an (ISBLANK( to just leave the calculated column blank if no date was entered but I keep getting the syntax error message.Just a basic: =IF(ISBLANK(""),"Yes","No")...
    This topic first appeared in the Spiceworks Community

    To exclude the weekends and do the subtractions, you can try to use the YEAR, MONTH, DAY and WEEKDAY function to handle the date in use and use IF function to perform the subtractions
    Calculated Field Formulas
    Another workaround is that we can create an Event Receiver for this, with SharePoint Object Model and other powerful APIs, we can update the Board Date column with the calculated
    value when there is a new item added to this list.
    SharePoint Object Model - SPListItem class
    Add, Update and Delete List Items Programmatically
    in Sharepoint
    More information about SharePoint Object Model:
    Here is a step by step sample on creating a simple Item added event receiver for Custom List in SharePoint 2010:
    More information on Event Receiver for your reference:
    Two links about
    DateTime Structure
    A demo about
    Programming DateTime using C#
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to add a new metadata field to iPhoto where new field is calculated as age in years and month based on a specific date and the date photo was taken ? I want to calculate and display the age of my two kids on every photo.

    How can I add 2 new metadata-fields to every photo in iPhoto ?
    The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
    My son is born 01.01.2010
    My daughter is born 01.01.2012
    Photo taken by data
    Aage of son
    Aage of daughter
    1 year 6 month
    not born yet
    4 year 0 month
    2 year 0 month
    I would like to be able to search by kids age and get the info displayed when doing slideshows.
    How to do this in iPhoto ?
    Any alternatives to accomplish the same ?
    Kind regards

    It can't be done with iPhoto.  There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
    However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
    If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field.  Then you can use Smart Albums to search for 1year 6 month text.

  • DAX Dynamic Banding | Calculated Member based on Calculated Field

    Good morning,
    I've created a Power Pivot model that measures the blood glucose levels of clinical patients at specific times of the day. The requirement is that this metric, let's call it GlucoseLevel, is always averaged as it wouldn't make sense to sum up the values.
    To meet this first requirement, I set the "Summarize By" property of the GlucoseLevel column to "Average".
    The second requirement is to band the GlucoseLevel values so that groups of people can be measured by this band rather than by the individual measure values. I created a banding table in Excel and then imported it into the Power Pivot model. The banding table
    has three columns (BandName, MinValue and MaxValue) and has the following values:
    VERYLOW: Min Value = 0; Max Value = 3.99
    OK: Min Value = 4; Max Value = 6.99
    WARNING: Min Value = 7; Max Value = 10.99CRITICAL: Min Value = 11; Max Value = 30.00
    It is at this point where I face my challenge. I have a GlucoseLevel measure and I have a banding table. Great. The challenge is: How do I create a calculated, dynamic
    member that will look at my GlucoseLevel measure (at whatever level), do a lookup to my banding table, and then return the "BandName" column from the Banding table at that specific level? So to clarify what I mean by level: I want to be able
    to view the bandings at Year level, or a Month level, or even at a week level. Then depending on what level I am at, my measure should have a Band associated to it.
    I've tried to solve this issue in a couple of ways:
    Attempt 1
    Create a calculated column in my fact table that contains a nested IF statement to manually band my GlucoseLevel values. This works fine if I view my data at the lowest level of granularity, however
    it does not work if I start looking at my data at the day, week, month etc. levels
    Attempt 2
    1.) Create a calculated field (not a calculated column) that averages my GlucoseLevel measure. This is cool because it will average my measure at whatever level I am viewing it at. Let's call
    this field Bob...
    2.) Band my measure Bob by creating another calculated field (called PatientBand). This field uses my banding table (described earlier) in conjunction with my calculated field Bob. This works perfectly, except for one big flaw: Excel sees this banding field
    as a measure, and not as something that I can use as a column / row...
    So my question is: Can I trick Excel into viewing my PatientBand calculated field as an attribute, and not as a measure? And if not, how do I get around this challenge? Here is the DAX formula that I used to create my second calculated field "PatientBand":
        VALUES (Bandings[BandName]);
        FILTER (
            Test[Bob] >= Bandings[MinValue]
         && Test[Bob] <= Bandings[MaxValue]

    So there are 2 ways that I can think of for doing that.
    1) if you are only using MDX clients like Excel or Reporting services you can create a text based measure that returns the banding name. (Note that this sort of approach does not work at the moment with PowerView as it only displays numeric measures). This
    would effectively let you show a label next to a reading as opposed to moving the reading under a given banding column.
    Banding Name :=
        VALUES ( Bands[BandName] ),
        FILTER (
            [Average of GlucoseReading] >= Bands[BandMin]
                && [Average of GlucoseReading] <= Bands[BandMax]
                && NOT ( ISBLANK ( [Average of GlucoseReading] ) )
    2) This next approach will show the results exactly as you had them in your sample screenshots. It just takes a slight bending of the DAX. I'm using a SUMX here, not because I want to sum anything, but because the "X" version of SUMX basically loops over
    every row in the specified table and sums the expression in the second parameter. I have setup the second parameter so that it only returns a single value for the average if it is in the appropriate banding. 
    Banded Average:=IF (
        HASONEVALUE ( Bands[BandName] ),
            IF (
                NOT ( ISBLANK ( [Average of GlucoseReading] ) )
                    && [Average of GlucoseReading] >= MIN ( Bands[BandMin] )
                    && [Average of GlucoseReading] <= MIN ( Bands[BandMax] ),
    ,AVERAGE(Readings[GlucoseReading]) - please mark correct answers

  • Problem with Math In Calculated Fields

    I am calculating a group incident rate for data returned from
    a query. The formula is Number of cases multiplied by 200000
    divided by number of hours worked. Cases in my report is the
    calculated field: calc.CaseSum (the sum of cases for the group)
    Hours is calc.SumHours (the sum of hours for the group). The actual
    values for these variables (for the first group are 48 and 29427171
    respectively. When I create the following calculated field called
    rate using the formula: (calc.CaseSum * 200000) / calc.SumHours,
    Cold Fusion Generates a Runtime Error:
    Invalid ColdFusion expression in report. If the expression is
    a string, ensure that it is within quotes. Error: (calc.CaseSum *
    200000) / calc.SumHours is not a valid ColdFusion expression.
    If I use the constant value "29427171" as the divisor, the
    report works albeit only for the first group. Any ideas; is this a
    bug, or am I misusing the product?
    Addition: I forgot to mention I am using CF8. Also this
    formula worked fine as a Report Total before I introduced grouping
    and modified the calculated fields to reset on the change of a

    Sorry, I've been on another project for awhile. This problem
    will certainly be a "show stopper" for me if I cannot resolve it.
    As I mentioned in my original post, I used a constant in the
    formula in lieu of the variable and the calculation worked. This
    would suggest that CF does not have a problem with a large number.
    In spite of that reasoning, I tried Tony's suggested (thanks
    by the way!) with the identical outcome, only difference is the new
    formula is displayed in the error message.
    Tony, you also suggested that I set the variables using
    CFSET... How would I do this within the report writer environment.
    I had tried a similar approach: to perform half the calculation
    i.e. that within the parenthesis, and assign that value to a
    separate "calculated field: and then perform the rest of the
    calculation on that variable with the same outcome.
    I think that I may be dealing with a CF bug here, I'd like to
    find a workaround... I've noticed that CF8 has a new patch, perhaps
    after I apply it, I may be able to get this thing to work. I'm on
    another project right now so it will be a few days before I can
    test this theory, I report the result.
    Should this fail, and no one can come up with a workaround, I
    will report this to Adobe.

  • Updatable property of Calculated Field in ViewObject does not work

    I have set the Updatable property of some ViewObject attributes to "while new".
    In the page those attributes are shown as <af:inputListOfValues> components.
    When creating a new row, those components properly appear as enabled and let me insert any values, since the row is new.
    However, after a following commit, once the table in the page is refreshed, I still see some components enabled on the row I committed before. This only happens with attributes based on calculated fields, not with those based on real table fields, as if the "while new" property specified on the ViewObject calculated fields was ignored.
    Do you know why? Is there a solution or work around?
    Below are the ViewObject XML section and the af:component definition based on the attribute.
    <Attr Name="_DisplaySize" Value="15"/>
    <af:inputListOfValues id="ilov1"
    popupTitle="Search and Select: #{bindings.BLOCK.hints.Cod.label}"
    <f:validator binding="#{row.bindings.Cod.validator}"/>

    The question is what does this "require" flag do? We read the book of life (cl_htmlb_inputfield), and see that this flag only controls in the first instance a little red * that is rendered next to the input field. This is a pure visualization for the user of the page.
    In addition you can ask that a check be done in the browser. This you can do with:
      <htmlb:inputField  id = "wander"
                         value = "E"
                         required = "TRUE"
                         doValidate="true" />
    However, I would not serious recommend this. Now even if you user presses a cancel button, or link, or breadcrumb, or..., the check will still complain.
    What we currectly do (and recommend), is to set the required flag on the <htmlb:<b>label</b>/> tag. And then do the actual checking on the server (must be done in anycase). If no value, or not correct, then also set the "invalid" flag, render out error message and redo page.

  • Calculated field in a query

    To begin with I am just learning EJB and JAVA so please bear with me. I want to create a calculated field in a query from two fields in the table being queried, using SQL I would write the query like this:
    SELECT ledgerdate, description, quantity, unitprice, [quantity*unitprice] FROM ledger
    I have created a class called ViewLedger to contain my results, it has the following elements:
    DATE ledgerdate,
    STRING description,
    INTEGER quantity,
    BIGDECIMAL unitprice,
    BIGDECIMAL amount
    The query that I have been attempting that fails is:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, l.quantity*l.unitprice) FROM Ledger l
    The error says that there is an unexpected * in the query
    The following do not work either:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, (l.quantity*l.unitprice)) FROM Ledger l
    The error says there is an unexpected ( in the query.
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, [l.quantity*l.unitprice]) FROM Ledger l
    The error says there is an unexpected [ in the query.
    Any help would be greatly appreciated.

    I don't think JPQL allows functions (*) in the SELECT clause.
    You can use a native SQL query as a workaround. If you are using EclipseLink or TopLink Essentials, you can also use a ReportQuery.
    You may also want to vote for the bug,
    James : [|]

  • Best Solution for Creating an Onlne Purchase order form with multiple calculation fields

    I am a bit confused.  Our school has a Forms Central account which works great for our registration forms but I need to find a solution for creating an online purchase form with multiple calculation fields - I know that forms central does not support calculation fields (too bad) but I know that Acrobat Pro does... soooo...
    Can you create the forms in Acrobat and then somehow integrate the advanced features into forms central?  Do they talk to each other?  Is this easy to do? .... I guess another way to putting it is can you create the forms in Acrobat including all of the advanced features for payment calculation and then host it online using Forms Central to manage and collect the data? (I guess that really is my question)
    Thanks (how does this compare to a solution like Formstack?)

    Hi, thanks.
    The naming convention was the consistant up until a point when I read that you need a '.' syntax (?!) - does anyone know if this is true?
    Attached is a version with Bernd Alheit's suggestion and with all the naming of the fields being consistant. It's still not working for me though after doing this and I'm stuck as to why, because I think it should work. I've also tried writing the calcualting line of code in the same manner that Bernd Alheit suggests before I came on here, and it wouldn't work then.
    As with any coding, it must be something to which I have done, but I can't see it anywhere
    Any ideas? Thanks for helping me

  • Can I create calculated fields using formscentral on a locally created, fillable PDF form?  If so, how?

    I am using Acrobat XI Pro to build a fillable PDF form that can be used by customer who have Adobe Reader installed.  I would like to create calculated fields, including the summation of two or more currency fields and the product of a currency and number field.  The procedure for creating these escapes me.  Does anyone have any insight?

    Hi Gilad,
    thankyou! - yes it seems though I was using the text tool when I had this problem: When I had created a few fields in the 'form edit' mode I then may later have added some normal 'comment' fields of text in the normal mode to highlight certain aspects on a form - I used the text tool thinking that was the right way in to add or edit text - I can now see I double click with the hand tool to still be able to access any text field I want to. Yay!
    Many thanks for your kind assistance - I shall try this method later on a new form I was trying to create and which was giving me grief.
    One last thing then: what is that default text field that can't be deleted actually for - why is it there? After all, a 'blank pdf' should surely be a truly blank pdf? Perhaps this is one for mighty Adobe....?
    Kind Regards,

  • Adding a new Search Field in Advance Search

    In 1 of the advance search regions, :
    We have a search panel in the adv search RN. In the poplist we have say 10 fields. We can add either of these 10 fields and use for searching. Now I want to add another search field ( an attribute from a table).
    Question 1 :*
    How to find the underlying VO from which the search fields are coming. I saw the page ( about this page) but couldn't find anything.
    Question 2:*
    Suppose I get the VO (resolution from above question) , if my extra filed is not there I add it in the VO ( VO extn), now how to configure this new field to the existing search panel fields?

    I think search fields are not mapped to any VO. If this is your standard page, check the standard controller. It might be getting values from pageContext.getparameter().
    You can create a new item using 'Personalize this Page' option and extend your controller to set where clause for the same.

  • Calculated Field formula not appearing in Power View Field List panel

    On Power View1 sheet of this
    workbook, the two PowerPivot calculated Field formulas (First Visit and First date of FY) are not appearing in the Power View Fields panel on the right hand side.
    I want to drag client and First Visit (calculated Field) to the Power View.
    Why is this happening?
    Regards, Ashish Mathur Microsoft Excel MVP

    I found a workaround for it - I was having the same problem as you. I wanted to display the last refresh date of my data, but Power View wouldn't display a date resulting from the [Last Refresh]=MAX(Date[Date]) formula.
    HOWEVER, a Pivot Table can handle that Calculated field just fine. So I renamed my measure "Refreshed Date" and added another tab in the Excel Sheet. I added a Pivot Table from PowerPivot into cell A1 and the only thing I put was that single
    measure (A2). To the right of that, I did =A2 and created an Excel Data Table. The title of that was "Last Refresh". Now, I could add that Data Table to the PowerPivot Model and into Power View. And then I hid that tab.
    The only downside to this method, is that if you're refreshing single tables at a time, you have to remember to refresh the Pivot Table when new data is added AND update the data in the model. I'm only connecting to one database, so I just choose
    "Refresh All" in Excel and it updates everything. It works perfectly! :)
    Well shoot, I even took a screenshot that helped explain everything, but it won't let me post it because my account isn't verified and it won't tell me how. If you have any questions, please let me know and I'll clarify!

  • Is there a limit to calculation fields in Acrobat 9?

    Using Acrobat 9 on Mac OS 10.6.8
        I have a 4 page form with about 30 or more calculation fields.
         When I look at the set calculation order there 24 names there minus the 3 that I am trying to get to work on save.
         3 of the calculation fields will not save.
         Sometimes they will show in the "Set Field Calculation Order" but when I save and reopen they will no longer show up and will not calculate.
         Does anyone have any idea as to why this is?
    Ron A

    Hi George
    I was trying to help the previous questioner.
    Your script is good and I saved it.
    However I think the form is corrupted and would not save the changes and function.
    The other person found a solution by doing a document level script and it will save and give the total, but you can retype the total and it will not recalculate unless you change one of the fields the total is derived from.
    Ron A

  • Use calculated field(s) in other report

    Hi everyone,
    Is there a way to use a calculated field by itself in another report? I don't want to insert a sub report because it takes up too much space.
    I just need to use few fields in other calculations in the new report.
    Thank you

    The only way I can think of doing this without subreports is to save the values in a database somewhere.  In order to do this, the values would have to be calculated in the report's SQL Command data source.  (I'm guessin' that's probably not what you're looking for, but using subreports is the only other way I can think of...)

Maybe you are looking for

  • Transporting ZIDOC from DEV to QA

    Hi people, How can I transport an ZIDOC from DEV system to QA system? Didn't find a way of putting an IDOC in a transport request... we can transport ZIDOC's by this way or there is another way? thank you, roberti

  • How to call an htm page or internet explorer

    Hi, I have requirement to create help button in WEB UI and when clicking the help it should open my custom html page.. Currently i have the word document. Should i have to create a BSP application and if so how will i copy all the contents to the htm

  • Idoc: Send all text in REQOTE.

    Hi, Actually the idoc send part of text in the reqote, but my requirement is send all header and position text of the order. The segment E1EDPT1 send text A05 and A01, but i need add text A04, A06..etc How add this text in IDOC (Segment) ?.

  • Restored phone after it fell in toilet but the screen is black. What can I do now?

    My phone fell in the toilet and I was told to try restoring it to see if it might still work. I restored it and itunes recognized it. The problem is I cant see anything on the screen it is black and vibrates out of no where. What should I do now?

  • Delta back ups in Time Machine?

    Does Time Machine use the new delta update  technology similar to the delta updates the Mac App Store uses? I mean, does it back up at the bit level or file level?