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 →

TypeDefaultDescription
datetime0000-00-00 00:00:00Format: yyyy-MM-dd HH:mm:ss or RFC3339.
e.g.: 2020-01-01 05:10:00
or 2020-01-01T05:10:00+08:00.
date0000-00-00Format: yyyy-MM-dd or yyyyMMdd.
e.g.: 2020-01-01 or 20200101.
time00:00:00Format: HH:mm:ss or HHmmss, HH:mm or HHmm.
e.g.: 05:10:00 or 051000, 05:10 or 0510.

Tips:

Duration

For use cases, see Excel wellknown types: Duration →

TypeDefaultDescription
duration0sFormat 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.5h or 2h45m.
Valid time units are ns, us (or µs), ms, s, m, h.

Tips:

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.

TypeDefaultDescription
fraction0Format:
- 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.: 3 is same to 3/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.

TypeDefaultDescription
comparator==0Format: <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.

TypeDefaultDescription
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.
}