Enhancing Datorama Capabilities: Your Guide to Custom Functions - Digital Analyst Team
logo
logo

Get in touch

Awesome Image Awesome Image

Digital Media Blog

Enhancing Datorama Capabilities: Your Guide to Custom Functions

Writen by Magesh

comments 0

Datorama­ Capabilities

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:

Datorama in JavaScript

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:

Datorama's Formula Editor

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:

Average Sale Per Transaction Code

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.