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
Type | Default | Description |
---|---|---|
datetime | 0000-00-00 00:00:00 | Format: yyyy-MM-dd HH:mm:ss .e.g.: 2020-01-01 05:10:00 . |
date | 0000-00-00 | Format: yyyy-MM-dd or yyyyMMdd .e.g.: 2020-01-01 or 20200101 . |
time | 00:00:00 | Format: HH:mm:ss or HHmmss , HH:mm or HHmm .e.g.: 05:10:00 or 051000 , 05:10 or 0510 . |
Tips
datetime
anddate
are based on google.protobuf.Timestamp, see JSON mapping.time
is based on google.protobuf.Duration, see JSON mapping.
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.5h or 2h45m .Valid time units are ns , us (or µs ), ms , s , m , h . |
Tips
duration
is based on google.protobuf.Duration, see JSON mapping.- golang duration string form.
- golang ParseDuration.
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.: 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.
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; // >=
}
}