Skip to main content
Version: Next

Data Management Reference

Complete reference for data management functions, field types, and troubleshooting.


Formula Functions Reference

Date Functions

FunctionSyntaxDescriptionExample
DATEDATE(year, month, day)Create a dateDATE(2024, 1, 15) = 2024-01-15
DATEDIFDATEDIF(start, end, unit)Calculate differenceDATEDIF("2024-01-01", "2024-01-15", "D") = 14
DAYDAY(date)Extract dayDAY("2024-01-15") = 15
DAYSDAYS(end, start)Calculate daysDAYS("2024-01-15", "2024-01-01") = 14
HOURHOUR(time)Extract hourHOUR("14:30:00") = 14
MINUTEMINUTE(time)Extract minuteMINUTE("14:30:00") = 30
MONTHMONTH(date)Extract monthMONTH("2024-01-15") = 1
NOWNOW()Current date and timeNOW() = 2024-01-15 14:30:25
SECONDSECOND(time)Extract secondSECOND("14:30:45") = 45
TODAYTODAY()Current dateTODAY() = 2024-01-15
WEEKDAYWEEKDAY(date, [type])Day of weekWEEKDAY("2024-01-15", 1) = 2
WEEKNUMWEEKNUM(date, [type])Week numberWEEKNUM("2024-01-15", 1) = 3
YEARYEAR(date)Extract yearYEAR("2024-01-15") = 2024

Logical Functions

FunctionSyntaxDescriptionExample
ANDAND(expr1, expr2, ...)Returns TRUE if all are trueAND([Temp] > 80, [Pressure] > 50)
FALSEFALSE()Returns FALSEFALSE()
IFIF(condition, true_val, false_val)Conditional logicIF([Score] > 60, "Pass", "Fail")
NOTNOT(expr)Logical negationNOT([Alarm_Active])
OROR(expr1, expr2, ...)Returns TRUE if any is trueOR([Status] == "Fault", [Status] == "Error")
TRUETRUE()Returns TRUETRUE()

Text Functions

FunctionSyntaxDescriptionExample
CHARCHAR(number)Convert to Unicode characterCHAR(65) = "A"
CONCATENATECONCATENATE(str1, str2, ...)Join stringsCONCATENATE("Line", "1") = "Line1"
LEFTLEFT(text, [count])Extract left charactersLEFT("ABCD", 2) = "AB"
LENLEN(text)Get string lengthLEN("ABCD") = 4
LOWERLOWER(text)Convert to lowercaseLOWER("ABCD") = "abcd"
MIDMID(text, start, length)Extract substringMID("ABCD", 2, 2) = "BC"
REPLACEREPLACE(text, pos, len, new)Replace substringREPLACE("ABCD", 1, 2, "XY") = "XYCD"
RIGHTRIGHT(text, [count])Extract right charactersRIGHT("ABCD", 2) = "CD"
TEXTTEXT(value, format)Format value as textTEXT(TODAY(), "yyyy-MM-dd")
TODATETODATE(text)Convert text to dateTODATE("2024-01-15")
TRIMTRIM(text)Remove extra spacesTRIM(" ABC ") = "ABC"
UPPERUPPER(text)Convert to uppercaseUPPER("abcd") = "ABCD"

Numeric Functions

FunctionSyntaxDescriptionExample
ABSABS(number)Absolute valueABS(-5) = 5
AVERAGEAVERAGE(val1, val2, ...)Calculate averageAVERAGE(10, 20, 30) = 20
COUNTCOUNT(val1, val2, ...)Count numeric valuesCOUNT(1, 2, 3, 4, 5) = 5
COUNTACOUNTA(val1, val2, ...)Count non-empty valuesCOUNTA("A", "B", "", "C") = 3
MAXMAX(val1, val2, ...)Maximum valueMAX(10, 20, 30) = 30
MEDIANMEDIAN(val1, val2, ...)Median valueMEDIAN(1, 2, 3, 4, 5) = 3
MINMIN(val1, val2, ...)Minimum valueMIN(10, 20, 30) = 10
RANDRAND()Random number (0-1)RAND() = 0.42
RANDBETWEENRANDBETWEEN(min, max)Random integerRANDBETWEEN(1, 100) = 58
ROUNDROUND(number, digits)Round to digitsROUND(3.14159, 2) = 3.14
ROUNDDOWNROUNDDOWN(number, digits)Round downROUNDDOWN(3.99, 0) = 3
ROUNDUPROUNDUP(number, digits)Round upROUNDUP(3.01, 0) = 4
SUMSUM(val1, val2, ...)Sum valuesSUM(10, 20, 30) = 60

Special Functions

FunctionSyntaxDescriptionExample
PREVALUEPREVALUE(field)Get previous record valuePREVALUE([Temperature])
CHANGECHANGE(field, range)Calculate change from previousCHANGE([Counter], 1000)

PREVALUE Example:

[Current_Value] - PREVALUE([Current_Value])

Calculates the difference between current and previous record.

CHANGE Example:

CHANGE([Cumulative_Count], 10000)

Returns the difference from previous value. If negative (counter reset), automatically adds the range value.


Field Types and Rules

Field Types

TypeDescriptionUse Cases
NumericNumbers (integer or decimal)Temperature, pressure, count, duration
TextStrings (letters, numbers, symbols)Status, product code, operator name
DateTimestampsStart time, end time, record time

Grouping Rules (Aggregation Tables)

Numeric Fields:

  • Same Value: Group records with identical values

Text Fields:

  • Same Value: Group records with identical values

Date Fields:

  • By Year: Group by year (2024, 2025)
  • By Quarter: Group by quarter (Q1, Q2, Q3, Q4)
  • By Month: Group by month (January, February)
  • By Week: Group by week number (Week 1, Week 2)
  • By Day: Group by day (2024-01-15, 2024-01-16)
  • By Hour: Group by hour (00:00, 01:00, 02:00)
  • By Minute: Group by minute (00:00, 00:01, 00:02)
  • Same Value: Group by exact timestamp

Aggregation Rules (Aggregation Tables)

Numeric Fields:

  • Sum: Total of all values in the group
  • Average: Mean of all values in the group
  • Maximum: Highest value in the group
  • Minimum: Lowest value in the group
  • Distinct Count: Number of unique values
  • Count: Number of records

Text Fields:

  • Distinct Count: Number of unique values
  • Count: Number of records

Date Fields:

  • Earliest: First timestamp in the group
  • Latest: Last timestamp in the group

Storage Management

Retention Guidelines

Archiving FrequencyRecommended RetentionReason
Every second3-6 monthsHigh data volume
Every minute1-2 yearsModerate data volume
Hourly3-5 yearsLow data volume
Daily5-10 yearsVery low data volume

System Requirements

  • Storage: SSD required for data archiving
  • RAM: 8GB minimum, 16GB+ recommended
  • Archiving Capacity: 5,000 records/second (standard configuration)

Troubleshooting

Data Not Recording

Symptoms: No new records appear in the data table.

Possible Causes:

  1. Data Service is not running
  2. Trigger conditions are not met
  3. Tag values are not updating
  4. Table is disabled

Solutions:

  1. Click Run Settings → Verify Data Service is Running
  2. Check trigger configuration:
    • For Tag Trigger: Verify expression evaluates to true
    • For Scheduled Trigger: Verify schedule is correct
    • For Field Change Trigger: Verify field value is changing
  3. Check tag values in Tag ManagerStart Debug
  4. Right-click table → Verify it's Enabled
  5. Review Data Service logs for errors

Formula Returns Empty Values

Symptoms: Field shows empty values instead of calculated results.

Possible Causes:

  1. Formula syntax error
  2. Data type mismatch
  3. Referenced fields are empty

Solutions:

  1. Click Edit FieldValidate Formula
  2. Check for syntax errors (missing brackets, incorrect function names)
  3. Verify field types match formula expectations:
    • Numeric formula → Numeric field type
    • Text formula → Text field type
    • Date formula → Date field type
  4. Test formula with sample data
  5. Check if referenced fields have values

Aggregation Table Not Updating

Symptoms: Aggregation table shows old data or no data.

Possible Causes:

  1. Aggregation trigger not configured
  2. Source table is not updating
  3. Grouping/aggregation fields misconfigured

Solutions:

  1. Verify source table is recording data
  2. Check aggregation trigger configuration:
    • For Real-time Update: Verify it's enabled
    • For Scheduled Trigger: Verify schedule is correct
  3. Manually trigger aggregation: Right-click table → Refresh Aggregation
  4. Check for grouping/aggregation field configuration errors
  5. Verify at least one grouping field and one aggregation field exist

Storage Space Running Out

Symptoms: Disk space warning, slow system performance.

Possible Causes:

  1. Retention period too long
  2. Archiving frequency too high
  3. Too many tables archiving data

Solutions:

  1. Review table sizes: Right-click table → Properties
  2. Reduce retention period in Storage Settings
  3. Enable Auto Cleanup and Auto Backup
  4. Manually export and clear old data
  5. Consider reducing archiving frequency
  6. Upgrade storage (SSD recommended)

Performance Degradation

Symptoms: Slow data recording, UI lag, high CPU usage.

Possible Causes:

  1. Too many tables archiving simultaneously
  2. High archiving frequency
  3. Insufficient system resources
  4. Real-time aggregation on large tables

Solutions:

  1. Monitor system resources (CPU, RAM, Disk I/O)
  2. Reduce archiving frequency for non-critical tables
  3. Disable real-time aggregation for large tables
  4. Schedule aggregations during low activity periods
  5. Upgrade system hardware (RAM, SSD)
  6. Distribute archiving across multiple tables

Cannot Delete Table

Symptoms: Error message when attempting to delete a table.

Possible Causes:

  • Table is used as a source for aggregation tables

Solutions:

  1. Identify dependent tables (error message lists them)
  2. Delete dependent aggregation tables first
  3. Then delete the source table
  4. Or keep the source table and only delete aggregation tables

Next Steps