GetChartDataByFilter(Int32,Nullable<Int32>,String,Nullable<Int32>,String,String,String,String,String,String,String,String,String,Nullable<DateTime>,Nullable<DateTime>,Nullable<Int32>,Int32,DateTime) Method
- Last UpdatedNov 06, 2025
- 6 minute read
For the specified characteristic, the GetChartDataByFilter() method retrieves the chart data for all samples that match the filter parameters. Passing no filter parameters will retrieve all the measurements for all of the characteristic's samples.
This overload of the method retrieves the chart data by characteristic and entity IDs. This overload also includes the lastCreatedAtUtc input parameter, which allows you to filter on samples whose results were added on or after a specified date and time.
'Declaration
Public Overloads Shared Function GetChartDataByFilter( _
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), _
ByVal numberOfPoints As Nullable(Of Integer), _
ByVal chartType As Integer, _
ByVal lastCreatedAtUtc As 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 numberOfPoints As Nullable(Of Integer)
Dim chartType As Integer
Dim lastCreatedAtUtc As Date
Dim value As DataSet
value = Sample.GetChartDataByFilter(characteristicId, entityId, item, itemCategoryId, workOrderId, operationId, processId, segmentRequirementId, segmentResponseId, spare1, spare2, spare3, spare4, startTime, endTime, numberOfPoints, chartType, lastCreatedAtUtc)
public static DataSet GetChartDataByFilter(
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,
Nullable<int> numberOfPoints,
int chartType,
DateTime lastCreatedAtUtc
)
Parameters
- characteristicId
- Required. Holds the characteristic ID.
- entityId
- Optional filter parameter. Holds the ID of the entity of a sample.
- item
- Optional filter parameter. Holds the item ID of a sample.
- itemCategoryId
- Optional filter parameter. Holds the ID of an 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.
- numberOfPoints
- Optional filter parameters. Specifies the maximum number of data points that will be returned for the chart. If null, all data points are included in the chart.
- chartType
Required. An enumeration that indicates the chart type.
2 = Xbar + Range
3 = Xbar + Sigma
5 = IX + IR
7 = MA + Range
8 = MA + Sigma
16 = p
17 = np
18 = u
19 = c
20 = DPMO
- lastCreatedAtUtc
- Required. Specifies the date and time in UTC to filter the chart data by only samples that have had results added at that date and time or later. This parameter will filter on the created_at_utc column of the Result table.
Return Value
Returns a DataSet that contains the chart data for all the samples collected for the specified characteristic that match the supplied filters.
The columns of the returned DataSet are described below.
| Column Name | Description |
|---|---|
| sample_id | An integer that is the ID of the sample from which the characteristic measurement came. From the Sample table. |
| primary_cl | A double that is center line for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| primary_lcl | A double that is the lower control limit for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| primary_ucl | A double that is the upper control limit for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_cl | A double that is the center line for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_lcl | A double that is the lower control limit for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_ucl | A double that is the upper control limit for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| requested_time_local | A datetime that is the time when the sample was requested in the local time of the entity at which the sample was collected. From the Sample table. |
| requested_time_utc | A datetime that is the time when the sample was requested in UTC. From the Sample table. |
| requested_time | A datetime that is the time when the sample was requested in the local time of the client application that is making the call. This value is calculated from the UTC date/time value and the call's time zone information. |
| note | A string that is the notes for the sample-characteristic pair. From the Sample_Char_Link table. |
| value_no | An integer that is the index of the measurement within the sample. From the Result table. |
| result_value | A double that is the value of the measurement. From the Result table. |
| act_sample_size | An integer that is the size of the sample if individual measurements are not being stored. From the Sample_Char_Link table. |
| created_at_utc | A datetime that is the time when the result was entered, in UTC. From the Result table. |
| cause_id | An integer that is the ID of the cause for the sample. From the Sample_Char_Link table. |
| cause_desc | A string that is the description of the cause. From the Cause table. |
| ignore_sample | A Boolean flag that specifies whether the sample should be ignored when calculating statistics and control rule violations for the characteristic. From the Sample_Char_Link table. |
| control_move | A Boolean flag that specifies whether there was a change to an environmental factor for the sample that would render old control limits obsolete. From the Sample_Char_link table. |
| x_axis_label | A string that is the x-axis label. The source for the label is based on the value passed for the xAxisLabel input parameter. If no value was passed, the label is the sample number, which is an incremental number generated by the chart. |
The center line and control limits returned from each point are obtained from the characteristic or from the overrides assigned to the QM specification assigned to the sample-characteristic pair. If a QM specification is assigned to the sample-characteristic pair and the QM specification has override values, those values are used. Otherwise, the values assigned to the characteristic are used.
Note that the chartType parameter is not a filter parameter. It is used to override the chart type that is associated by default with the characteristic. Also, the numberOfPoints parameter is not a filter parameter per se but can be used to limit the amount of chart data that is being returned.
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.