Datorama provides a range of standard features for data manipulation and visualization. For more complex needs that go beyond the default capabilities, Datorama allows users to implement custom scripts, calculations, and expressions. This guide will explain how to use these advanced features for specialized data manipulation and calculations.
Custom Scripts: Data Manipulation on Ingestion
JavaScript in Datorama
Datorama allows you to use JavaScript to write custom scripts that can alter your data as it is ingested into the platform. These scripts can clean, transform, and enrich data according to specific requirements.
Implementation Steps
- Go to the Data Sources section and select the relevant data source.
- Click on ‘Advanced Settings’ and then select ‘Custom Scripts.’
- Write JavaScript code to act on each incoming row of data.
Example
If you have a “Sales Data” column with values in different currencies, you could convert all values to USD with this script:
Calculations: Formula Editor
Using Datorama’s Formula Editor
For simpler calculations, Datorama provides a Formula Editor that enables you to create calculated metrics without coding.
Implementation Steps
- Go to the Metrics section in the Dashboard.
- Click on ‘Create New Metric’.
- Use the Formula Editor to input your calculations.
Example
To create an ROI (Return on Investment) metric, you could use the formula:
Custom Expressions: Real-time Calculations in Widgets
Using SQL-like Expressions
Datorama offers custom expressions that can be used directly within widgets for real-time calculations. The syntax is similar to SQL and supports a range of operations.
Implementation Steps
- Create or edit a widget.
- Go to the widget’s settings, under the ‘Data’ tab.
- Insert your custom expressions in the appropriate fields.
Example
To calculate the average sale per transaction, you can use:
Conclusion
Datorama’s standard features are adequate for basic and moderately complex data manipulation tasks. However, for more specialized needs, custom scripts, calculations, and expressions can be used for further customization. By effectively using these advanced features, you can perform a wider range of data manipulations and calculations in Datorama.
You can increase Datorama’s functionality to meet your unique data analysis needs by becoming proficient with these tools.

Magesh
Magesh is a distinguished Data Scientist with over 14 years of experience in Advanced Analytics, Machine Learning, and Artificial Intelligence. As the Vice President of Analytics, he brings a wealth of expertise in tools such as R, SPSS, Tableau, Power BI, and Google Analytics. Magesh is renowned for his profound analytical problem-solving skills and strategic decision-making abilities, making him a leading force in transforming complex data into actionable insights.