GetChartTypeByFilter(Int32,Nullable<Int32>,String,Nullable<Int32>,String,String,String,String,String,String,String,String,String,Nullable<DateTime>,Nullable<DateTime>) Method
- Last UpdatedNov 06, 2025
- 6 minute read
The GetChartTypeByFilter() method retrieves the chart type and the data for determining the control limits for a characteristic identified by its ID, with optional sample filters. Passing no filter parameters will retrieve the chart type for the most recent sample entered for the characteristic.
This overload of the method uses the characteristic ID and entity ID.
'Declaration
Public Overloads Shared Function GetChartTypeByFilter( _
ByVal characteristicId As Integer, _
ByVal entityId As Nullable(Of Integer), _
ByVal item As String, _
ByVal itemCategoryId As Nullable(Of Integer), _
ByVal workOrderId As String, _
ByVal operationId As String, _
ByVal processId As String, _
ByVal segmentRequirementId As String, _
ByVal segmentResponseId As String, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal startTime As Nullable(Of Date), _
ByVal endTime As Nullable(Of Date) _
) As DataSet
'Usage
Dim characteristicId As Integer
Dim entityId As Nullable(Of Integer)
Dim item As String
Dim itemCategoryId As Nullable(Of Integer)
Dim workOrderId As String
Dim operationId As String
Dim processId As String
Dim segmentRequirementId As String
Dim segmentResponseId As String
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim startTime As Nullable(Of Date)
Dim endTime As Nullable(Of Date)
Dim value As DataSet
value = Sample.GetChartTypeByFilter(characteristicId, entityId, item, itemCategoryId, workOrderId, operationId, processId, segmentRequirementId, segmentResponseId, spare1, spare2, spare3, spare4, startTime, endTime)
public static DataSet GetChartTypeByFilter(
int characteristicId,
Nullable<int> entityId,
string item,
Nullable<int> itemCategoryId,
string workOrderId,
string operationId,
string processId,
string segmentRequirementId,
string segmentResponseId,
string spare1,
string spare2,
string spare3,
string spare4,
Nullable<DateTime> startTime,
Nullable<DateTime> endTime
)
Parameters
- characteristicId
- Required. Holds the characteristic ID.
- entityId
- Optional filter parameter. Holds the ID of an entity at which a sample was pulled.
- item
- Optional filter parameter. Holds the item ID of a sample.
- itemCategoryId
- Optional filter parameter. Holds the ID of the item category. Any samples of items included in the category will match this filter.
- workOrderId
- Optional filter parameter. Holds the work order ID of a job for which a sample was pulled.
- operationId
- Optional filter parameter. Holds the ID of an operation that is associated with the characteristic. This parameter will filter on the oper_id column of the Sample table. This parameter is used in conjunction with the processId parameter. The combination of a process and an operation in that process is entered as a context property of a QM specification that is linked to the characteristic. For more information, see Remarks below.
- processId
- Optional filter parameter. Holds the ID of a process that is associated with the characteristic. This parameter is used in conjunction with the operationId parameter. The combination of a process and an operation in that process is entered as a context property of a QM specification that is linked to the characteristic. For more information, see Remarks below.
- segmentRequirementId
- Optional filter parameter. Holds the segment requirement ID of a sample.
- segmentResponseId
- Optional filter parameter. Holds the segment response ID of a sample.
- spare1
- Optional filter parameter. Holds the contents of the spare1 field for a sample.
- spare2
- Optional filter parameter. Holds the contents of the spare2 field for a sample.
- spare3
- Optional filter parameter. Holds the contents of the spare3 field for a sample.
- spare4
- Optional filter parameter. Holds the contents of the spare4 field for a sample.
- startTime
- Optional filter parameter. Holds the earliest date/time that a matching sample can have. The date/time are assumed to be in the local time of the calling client application. This is converted to UTC, which is then used to filter on the requested_time_utc column of the Sample table.
- endTime
- Optional filter parameter. Holds the latest date/time that a matching sample can have. The date/time are assumed to be in the local time of the calling client application. This is converted to UTC, which is then used to filter on the requested_time_utc column of the Sample table.
Return Value
Returns a DataSet that contains a record from either the QM_Spec_Char_Link table or the Characteristic table. If a QM_Spec_Char_Link record exists and the required column is not null, the value for that column is returned; otherwise the value for the column in the Characteristic table is returned.
The columns of the returned DataSet are described below.
| Column Name | Description |
|---|---|
| default_chart |
An integer that is an enumeration that indicates the chart type. 2 = Xbar + Range 3 = Xbar + Sigma 5 = IX + MR 7 = MA + Range 8 = MA + Sigma 16 = p 17 = np 18 = u 19 = c 20 = DPMO |
| cl_source |
An integer that is an enumeration that indicates the control limit source. 0 = automatically calculated from data. 1 = compute from standard mean and standard deviation values (if variable) or compute from standard p, np average proportion and standard c, u average number of number per unit values (if attribute). 2 = preset values. |
| samples_for_cl | An integer that is the number of samples to use for calculating control limits. Only valid if cl_source = 0. A value of 0 means use all samples. |
| samples_before_cl | An integer that is the number of samples required before control limits are calculated. |
| std_avg | A double that is the standard average used for calculating control limits if cl_source = 1 and the chart type is variable. |
| std_deviation | A double that is the standard deviation used for calculating the control limits if cl_source = 1 and the chart type is variable. |
| type |
An integer that is an enumeration that indicates the characteristic type. 0 = variable (the default) 1 = binary attribute 2 = counted attribute |
| normal_sample_size | If the characteristic is variable or attribute with fixed sample size, an integer that is the normal number of measurements in a sample. If the characteristic is variable and the normal sample size is 1, then data is not grouped. |
| num_defect_opp | An integer that is the number of defect opportunities per piece for counted attribute. |
| num_decimals | An integer that is the number of decimals the number of decimals to display for values related to the characteristic. |
| qm_spec_id | An integer that is the QM specification ID. |
| mov_avg_span | An integer that is the moving average span used for plotting Moving Average/Moving Range and Moving Average/Moving Sigma charts. |
| item_id | A string that is the ID of the item from which the sample was generated. |
| item_desc | A string that is the description of the item from which the sample was generated. |
| category_name | A string that is the name of the item category that is assigned to the QM specification that is linked to the characteristic. |
| category_desc | A string that is the description of the item category that is assigned to the QM specification that is linked to the characteristic. |
| oper_id | A string that is the ID of the operation that is assigned to the QM specification that is linked to the characteristic. |
| lsv | A double that is the lower specification value. |
| usv | A double that is the upper specification value. |
| created_by | A string that is the ID of the user who entered the result values. If null, the ID of the caller is used. Applies to all the results for all characteristics. |
| ent_name | A string that is the name of the entity at which the sample was pulled. |
| uom_desc | A string that is the description of the unit of measure for the characteristic. |
| equipment | A string that is the equipment used to make characteristic measurements for the sample. |
| num_pts_per_page | An integer that is the number of points per chart page for the chart. |
If filter parameters are passed, the operation finds all the samples (Sample table) collected for the supplied characteristic that match the supplied filters. It then finds the sample with the most recently collected measurement (Result table). If a QM specification is assigned to the sample-characteristic link (Sample_Char_Link table), it is used to look up the values assigned to the QM specification-characteristic link (QM_Spec_Char_Link table). The values returned in the dataset are read from the QM specification-characteristic link information. If there is no QM specification-characteristic link information or no value is recorded for the QM specification-characteristic link, then the value assigned to the characteristic is returned.
If no filter parameters are passed, the operation retrieves the chart type for the most recent sample entered for the characteristic.
The context properties of the QM specifications that are linked to a characteristic are used to determine the conditions under which samples for that characteristic will be generated. A QM specification must have an entry for at least one of the three context properties: Entity, Item Category and Item, Process and Operation (see the operationId and processId filter parameters). For more information about QM specifications and characteristics, see the MES Client User Guide or help.