反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Date and string conversion

  • Recent Updates: April 26, 2022
  • 1. Overview

    1.1 Expected effect

    Sometimes, you need to convert the "Text" or "Value" field to the "Date" field type, for example, convert the numerical "1621221876057" field to the standard "Date" field, as shown in the following figure:

    2021-08-18_9-38-30.png

    1.2 Implementation ideas

    Use the self-service dataset "Add column" and implement it through "formula/function".

    Note: This paper lists some common conversion methods, which will be supplemented according to the actual data structure.

    2. Operation steps

    2.1 Add columns in self-service dataset

    Add a self-service dataset, select the numerical field under the corresponding dataset (this file takes the fixed data value 1621221876057 as an example), click "+" to add a new column, as shown in the following figure:

    2021-08-18_9-38-05.png

    Note: the functions and fields in the formula box need to be selected by clicking the selection area on the left, and cannot be entered manually.

    2.2 View the effects

    See more details in section 1.2.

    3. Other conversion examples

    Original field
    Conversion methodConversion results Attentions
    Wed1/15/07TODATE("Wed1/15/07","EEEMM/dd/yy","en")2007-01-15 00:00:00String converse to Time
    2021/02/07WedTODATE("2021/02/07Wed","yyyy/MM/ddEEE","en")2021-02-07 00:00:00String converse to Time
    21/02/07WedTODATE("21/02/07Wed","yy/MM/ddEEE","en")2021-02-07 00:00:00String converse to Time
    21/02/07/WedTODATE(replace("21/02/07/Wed","/W","W"),"yy/MM/ddEEE","en")2021-02-07 00:00:00String converse to Time
    1621221876057TODATE(1621221876057)2021-05-17 11:24:36Time type (the original field is 13 bit timestamp, accurate to milliseconds)
    1621221876TODATE(1621221876*1000)2021-05-17 11:24:36Time type (the original field needs 10 bit timestamp, accurate to the second level), 1s = 1000ms
    2020/05/22TODATE("2020/05/22")2020-05-22 00:00:00Convert YYMMDD/YYMM text type to "Date" type
    20200522TODATE("20200522","yyyyMMdd")2020-05-22 00:00:00Convert YYMMDD/YYMM text type to "Date" type
    202005TODATE("202005","yyyyMM")2020-05-01 00:00:00Convert YYMMDD/YYMM text type to "Date" type

    Three fields

    Year——2020

    Month——5

    Day——22

    DATE(Year,Month,Day)2020-05-22 00:00:00To save multiple fields of year, month and day, you need to process multiple fields into one date field
    2020-02-02FORMAT("2020-02-02","yyyyMM")202002Convert YYMMDD to YYMM
    2020-05-22TODATE(LEFT("2020-05-22",10))2020-05-22Remove the "hour, minute and second" from the data in the format of hour, minute and second of month, year and day
    2018/12/1/Sat 8:55:00TODATE(replace("2018/12/1/Sat 8:55:00","W","W"),"yyyy/MM/dd/EEE HH:mm:ss","en")2018-12-01 08:55:00String (including day of week) converse to time type


    Attachment List


    Theme: Advanced Data Analyis
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭