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

TypeDefaultDescription
datetime0000-00-00 00:00:00Format: yyyy-MM-dd HH:mm:ss.
e.g.: 2020-01-01 05:10: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

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

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

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;  // >=
  }
}