gkaindia.com

Home > > Averaging selected range based on value of another channel

Averaging selected range based on value of another channel

Advertisement
I have one channel, X, with a bunch of integer values from 0 to 90. I also have another channel with various corresponding data, lets call it Y. I would like to find the average and standard deviation for all of the values in Y that have a 0 in its corresponding X row, then the same for all values in Y that have a 1 in its corresponding row and etc, all the way up to 90. Is there an easy way to do this? Perhaps there is a way to sort the data and put all the Y values into new channels that are grouped according to their X values?
Advertisement
Hi Martin,
You have a couple of options.  You could indeed use the FormulaCalc() command to split out various rows from your data channel that all have the same index into a new data channel and do this for each index.  Alternatively, you could determine which rows contain a certain index, then use the StatBlockCalc() function to determine statistics from only these rows of your data channel:
Dim Channel, Msg
Channel = "[1]/Time"
For i = 1 To 22
  StatSel(i) = "No"
Next
StatSel(4)  = "Yes" ' Minimum
StatSel(5)  = "Yes" ' Maximum
StatSel(6)  = "Yes" ' Arith. mean
StatSel(14) = "Yes" ' Standard Deviation
Call StatBlockCalc("Channel", "1-13", Channel)
Msg = Msg & "Min = " & StatMin        & vbCRLF
Msg = Msg & "Ave = " & StatArithMean  & vbCRLF
Msg = Msg & "Max = " & StatMax        & vbCRLF
Msg = Msg & "Dev = " & StatDeviation
MsgBox Msg
Note that if you have DIAdem 10.1 you should loop up to 23,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Read the other 3 answers
This would be useful on its on or in conjunction with the Color Range tool. Maybe a beefed up Select Range tool. Color Range has difficulty with gradients & whatnot. Selecting using Contrast would be a way to overcome this. It would work best if it h
I want to select highlights from a channel with the color range ... I select "hightlights" on the color range window. Then, which values of the fuzziness and range sliders should I use for selecting highlights equal to the selecting them with ct
Hi Experts, I have a list box parameter in my selection screen, i have four options and i am changing my selection screen based the option selected. see my code below, at selection-screen output.   GS_VRM_VALUES-KEY = '1'.   GS_VRM_VALUES-TEXT = TEXT
Dear SQL gurus, I have a table T1: Name Null? Type ID NOT NULL NUMBER(5) MOMENT NOT NULL DATE [DD.MM.YYYY HH24:MI] MEASUREMENT NOT NULL NUMBER(8,3) Example (ID, MOMENT, MEASUREMENT) -- START OF EXAMPLE -- 9380 18.11.2000 03:45 17.6 9380 18.11.2000 04
I'm looking to try and average a range of numbers, but instead of doing it by certain rows (that is, average rows A1 through A30), I'd like for Numbers to average cells if they fall into a certain numerical range (that is, average cells whose values
Hi, I want to user the flashback query facility to capture the history of versions for a day (i.e) i want to get the data versions from morning 10 a.m to 6.pm. How to get the versions by using the time range for a day. I used the query as select a.en
Hi there,Does anyone know how to select members based on attributes using Excel VBA?I don't seem to be able to find macros or functions to do that.Pandayou can use the Range or the Cells objects to get a reference to your range values in this sample
Hi Friends, In BI, How to filter the selection options based on inputs on top field. The system should automatically filter the lower level drop downs based on the selection of a higher level. For e.g. : If a user selects a Country then the States dr
Hi, I have the following table... VALIDATIONS ID          Number     (PK) APP_ID          Number      REQUESTED     Date           APPROVED     Date           VALID_TIL     Date DEPT_ID          Number     (FK) I have a search form with the following
As suggested by Apple, I'm trying to create my first ePub using Pages as opposed to inDesign. I only have a PDF as a source file and don't want to re-type all the text. When I copy the text from the PDF and paste to Pages, the text comes in with the
Hi all, CAN ANYONE TELL ME HOW TO WRITE SELECT QUERY BASED ON SECONDARY INDEX. IN WHAT WAY DOES IT IMPROVE PERFORMANCE. i KNOW WHEN CREATING SECONDARY INDEX I NEED TO GIVE AN INDEX NO -iT SHOULD BE ANY NUMBER RIGHT? I HAVE TO LIST ALL PRIMARY KEYS FI
Hi Experts,     I have to write a report to pull data from a table BUT000 for a selected range of  BPEXT field values in selection screen.     In the table BUT000, the BPEXT field is type char. Now what is happening is that if the user gives a range
Hello, I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters t
Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.? I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).Hi To
Post Author: [email protected] CA Forum: Formula I'm writing reports for a company that stores all of their dates as 8 digit numerical fields rather than a date or datetime datatype. I want to convert this field to a date type, then compare it to a parameter
ID     PRO_ID     PRO_OBJ_ID     TASK_ID     DEVELOPER_ID     STATUS 121243     4940     37506     5250     6532     REJECTED 122063     4940     37506     5250     6532     CLOSE 138306     4940     37506     5250     6532     ACCEPTED 138307     49
Hi, I have a table with a date_added field and I want to select records based on the monthly anniversary date of this field. eg. ID, Date_added 1, 10-DEC-2012 2, 11-NOV-2012 3, 10-MAR-2012 4, 28-FEB-2012 5, 30-DEC-2012 So For the 10th of Jan 2013, I
Hi All, I have a page that has a select list based on a dynamic list of values. I wanted to test out how the system was working, so I truncated all of my tables, and now my select list is blank (which makes sense). The problem is that I can't type an
Hello, I would like to select specific materials (<b>MARA</b>) based on the assigned characteristics and values (<b>AUSP</b>). My first approach would be the following: select table AUSP with the characteristic and value, then sele