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.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive