Syntax error with beast mode
Trying to convert a column to seconds but I am getting a syntax error and cant figure out where the issue is..
TIME_TO_SEC(`AVG Answer`) + ( DATE_FORMAT(`AVG Answer`, '%f')/1000000)
Best Answer
-
@Stucker This looks like a datatype error. If I'm interpreting this correctly, you have a time field (`AVG Answer`) that you are trying to convert into a number of seconds/milliseconds. You are on the right track with the TIME_TO_SEC portion of the formula, but the problem is with the second part where you are looking for the number of milliseconds. The DATE_FORMAT function returns a text value, which cannot be used in mathematical expressions.
If you want to get down to millisecond granularity, then you will have to use a MagicETL instead of Beast Mode since the Formula Tile supports the MILLISECOND function, which returns a numerical output. Your calculation should look like this:
TIME_TO_SEC(`AVG Answer`) + ( MILLISECOND(`AVG Answer`)/1000000)
1
Answers
-
@Stucker This looks like a datatype error. If I'm interpreting this correctly, you have a time field (`AVG Answer`) that you are trying to convert into a number of seconds/milliseconds. You are on the right track with the TIME_TO_SEC portion of the formula, but the problem is with the second part where you are looking for the number of milliseconds. The DATE_FORMAT function returns a text value, which cannot be used in mathematical expressions.
If you want to get down to millisecond granularity, then you will have to use a MagicETL instead of Beast Mode since the Formula Tile supports the MILLISECOND function, which returns a numerical output. Your calculation should look like this:
TIME_TO_SEC(`AVG Answer`) + ( MILLISECOND(`AVG Answer`)/1000000)
1
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 710 Beast Mode
- 50 App Studio
- 39 Variables
- 668 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive