Replaceable parameters in sample names
- Last UpdatedOct 28, 2024
- 2 minute read
To easily identify the group of samples by a template name in a report, a replaceable parameter is used to generate sample names. When a sample is generated, the actual sample name (sample. sample name) is derived from the template sample name (sample_plan.sample_name) that is configured for the sample plan from which the sample is generated.
Replaceable parameters must be enclosed in square brackets []; for example, as a date string [yy]-[mm]-[dd] would create a sample name of 15-01-01 on January 1, 2015. This indicates that the characters can be replaced. [YYYY][MM][DD] represents date information and these must come from the requested_time_local field of the sample table.
The replaceable parameter that is configured inside the square brackets for the template sample name is resolved only if the replaceable parameter exactly matches the replaceable parameter that is defined in the table below and the result contains a non-null value. Otherwise, the replaceable parameter is used exactly as it is configured in the template sample name. If the replaceable parameter contains a date parameter, the date value is resolved to the local date (sample.requested_time_local).
If a replaceable parameter is nested inside other replaceable parameters, the replaceable parameters that exactly match with the replaceable parameters listed in the table below are replaced. However, the replaceable parameters will not recursively resolve other replaceable parameters when a value returned from one of the replaceable parameter is same as the replaceable parameter listed in the table below.
The following table shows a list of replaceable parameters that can be successfully replaced from the template sample name. The following table shows examples that use the current date by default (10/27/2015 local date).
|
Replaceable Parameter (Case Insensitive) |
Value Returned |
Example |
|---|---|---|
|
[YYYY] |
Year |
2015 |
|
[MM] |
Month of the year (integer) |
10 (with leading zeros) |
|
[MONTH] |
Name of the month |
October |
|
[DD] |
Day of the month |
27 (includes leading zeros) |
|
[WW] |
Week of the year |
44 (includes leading zeros) |
|
[DAY] |
Day (in full) of the week |
Tuesday |
|
[WD] |
Day of the week |
3 |
|
[DY] |
Day of the year |
298 (includes leading zeros) |
|
[EntityName] |
Name of the entity |
Blender |
|
[WorkOrderID] |
Work Order ID |
WO123456 |
|
[OperationID] |
Operation ID |
BlendingOperation |
|
[SequenceNumber] |
Job Sequence Number |
0 |
|
[ItemID] |
Item ID |
Item123456 |
|
[CharacteristicName] |
Characteristic Name If a sample contains more than one characteristic, the name from the first characteristic that is added to this sample is returned. |
Viscosity |
|
[QMSpecName] |
QM Specification Name |
QMSpecA |
|
[FrequencyName] |
Frequency Name |
FrequencyA |
|
[SamplePlanName] |
Sample Plan Name |
SamplePlanA |
|
[SegmentRequirementID] |
Segment Requirement ID |
SegmentRequirement |
|
[SegmentResponseID] |
Segment Response ID |
SegmentResponse |
|
[####] |
Integer value returning the next highest number. If none is found, it returns 1, including leading zeros. If the maximum is reached, then the maximum value is retained. The number of octothorpes is not limited for a template sample plan name. |
0001 (includes leading zeros) |