duration#
- swordfish.function.duration()#
Convert X to DURATION type which indicates the length of a time interval.
Note
The unit of the time interval used for grouping cannot be more granular than the unit of the temporal column.
Time units are case-sensitive, for example, “M” means month and “m” means minute. If the unit of the time interval is M, use function month to convert the time column values to months.
Data of DURATION type cannot participate in calculations. For example, comparisons between DURATION values (such as duration(20ms) >= duration(10ms)) are not supported.
- Parameters:
X (Constant) – A STRING scalar composed of an integer and a unit of time. It supports the following units of time: y, M, w, d, B, H, m, s, ms, us, ns, and trading calendar identifier consisting of four capital letters.