Wellknown types
Wellknown types contain common types that are used throughout the Tableau ecosystem.
Overview
For easy use, Wellknown types are built-in types in Tableau. This concept is much like Protocol Buffers Well-Known Types.
You should include the proto files provided by Tableau and Protocol Buffers:
Datetime
For use cases, see Excel wellknown types: Datetime ā
| Type | Default | Description | 
|---|---|---|
| datetime | 0000-00-00 00:00:00 | Format: yyyy-MM-dd HH:mm:ssor RFC3339.e.g.: 2020-01-01 05:10:00or 2020-01-01T05:10:00+08:00. | 
| date | 0000-00-00 | Format: yyyy-MM-ddoryyyyMMdd.e.g.: 2020-01-01or20200101. | 
| time | 00:00:00 | Format: HH:mm:ssorHHmmss,HH:mmorHHmm.e.g.: 05:10:00or051000,05:10or0510. | 
Tips:
- datetimeand- dateare based on google.protobuf.Timestamp, see JSON mapping.
- timeis based on google.protobuf.Duration, see JSON mapping.
- RFC 3339: Date and Time on the Internet: Timestamps
Duration
For use cases, see Excel wellknown types: Duration ā
| Type | Default | Description | 
|---|---|---|
| duration | 0s | Format like: 72h3m0.5s.A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms,-1.5hor2h45m.Valid time units are ns,us(orµs),ms,s,m,h. | 
Tips:
- durationis based on google.protobuf.Duration, see JSON mapping.
- golang duration string form.
- golang ParseDuration.
Fraction
For use cases, see Excel wellknown types: Fraction ā
A fraction represents a part of a whole or, more generally, any number of equal parts. See wiki: Fraction for more details.
| Type | Default | Description | 
|---|---|---|
| fraction | 0 | Format: - N%: percentage, e.g.:10%- Nā°: per thounsand, e.g.:10ā°- Nā±: per ten thounsand, e.g.:10ā±- N/D: simple fraction, e.g.:3/4- N: only numerator, e.g.:3is same to3/1 | 
message Fraction {
  int32 num = 1;  // numerator
  int32 den = 2;  // denominator
}
Comparator
For use cases, see Excel wellknown types: Comparator ā
A comparator holds a sign and a fraction value. Any number or fraction can compare with it.
| Type | Default | Description | 
|---|---|---|
| comparator | ==0 | Format: <Sign><Fraction>.e.g.: ==10,!=1/2,<10%,<=10ā°,>10%,>=10ā± | 
message Comparator {
  Sign sign = 1;
  Fraction value = 2;
  enum Sign {
    SIGN_EQUAL = 0;             // ==
    SIGN_NOT_EQUAL = 1;         // !=
    SIGN_LESS = 2;              // <
    SIGN_LESS_OR_EQUAL = 3;     // <=
    SIGN_GREATER = 4;           // >
    SIGN_GREATER_OR_EQUAL = 5;  // >=
  }
}
Version
For use cases, see Excel wellknown types: Version ā
A version represents the version number in dot-decimal notation.
Version form is: <MAJOR>.<MINOR>.<PATCH>[.<OTHER>]....
A version field holds three forms of representation for easy use:
- string version: str
- integer version: val
- integer version parts: major,minor,patch,others
You can specify the version pattern (a field property) as <MAJOR_MAX>.<MINOR_MAX>.<PATCH_MAX>[.<OTHER_MAX>]....
- Each part with suffix “MAX” represents the max decimal value of each part in the dot-decimal notation.
- Each part “XXX_MAX+1” represents the part’s value occupying in an integer.
- Integer version formula for general pattern <MAJOR_MAX>.<MINOR_MAX>.<PATCH_MAX>is:MAJOR*(MINOR_MAX+1)*(PATCH_MAX+1) + MINOR*(PATCH_MAX+1) + PATCH
Default pattern is: 255.255.255.
| Type | Default | Description | 
|---|---|---|
| version | "" | Format: <MAJOR>.<MINOR>.<PATCH>.e.g.: 1.0.1 | 
| version|{pattern:"255.255.255.255"} | "" | Format: <MAJOR>.<MINOR>.<PATCH>.<OTHER>.e.g.: 1.0.1.1 | 
message Version {
  string str = 1; // Version in string form.
  uint64 val = 2; // Version in integer form.
  uint32 major = 3; // Major version number.
  uint32 minor = 4; // Minor version number.
  uint32 patch = 5; // Patch version number.
  repeated uint32 others = 6; // Other version numbers, such as build number, resource version, and so on.
}