1

I found this url about this topic:

I didnt found the format for time-type. So I try to use sql: PARSE_TIMESTAMP('%Y-%m-%d', date)

    createdat: {
      sql: `PARSE_TIMESTAMP('%Y-%m-%d',${CUBE}.\`createdAt\`)`,
      type: `time`
    },

it will return a error:

Error: Error: scalar function 'parse_timestamp' is not supported
radiorz
  • 1,459
  • 4
  • 18
  • 36

1 Answers1

2
createdat: {
    sql: `DATE(${CUBE}.\`createdAt\`, '%Y-%m-%d')`,
    type: `time`
},

Thanks

ovr
  • 211
  • 1
  • 3
  • 1
    In the sql property, we use functions specific to the database we connected cube.js to. the example in the Docs they are using BigQuery. – Kaizendae Sep 07 '21 at 11:27