---
schema_version: "1"
id: 782baa68d366da0e8126ca9a640293754e1b7972f4c94054bcb951c9fe1a1c30
title: Speed Up Queries with Dataflow Transformations
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-performance-dataflow-transformations.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-dataflow-transformations.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 05cf668dcf75d93569482ddb4898185d750edafa58b25c3018a916e43b97c826
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Speed Up Queries with Dataflow Transformations

To speed up your queries and reduce the number of network round trips, perform data transformations in the ELT process instead of in the query.

## Example: GEO Field

Let’s say you have a dataset with the `GEO` field that contains the value `JP`, and you want to replace this value with `Japan`. One solution is to add a `case` statement to your query.

```nolang
q = foreach q1 generate (case when 'GEO' == \"JP\" then \"Japan\" else 'GEO' end) as 'GEO;'
```

Running this query on each row in a dataset is time-consuming. A faster approach is to add the `case` statement to the `saqlExpression` field in the dataflow’s `computeExpression` transformation. Moving the `case` statement from the query to the ELT process reduces the query’s network round trips.

```nolang
"parameters": {
    "source": "Opportunity_Data",
    "mergeWithSource": true,
    "computedFields": [{
        "name": "GEO",
        "type": "Text",
        "label": "GEO"
        "saqlExpression": "case when 'GEO' == \"JP" then \"Japan\" else 'GEO' end"}
]}
```

**tip:** You can also improve query performance by shortening decimal values in your dataflow. For example, if the numbers in your dataset have a single decimal digit, such as 9.1 or 924.3, set `scale` to 1 rather than 4 in the `computeExpression` transformation. Restricting the decimal value only impacts storage only. SAQL performs query calculations with all decimal values intact.

## Example: Date Format

To change the date format, you can add an intermediate query to filter the stream based on the list selector values. Adding an extra filter creates another network trip. Instead, transform the values in the `computeExpression` transformation, which you can use with SAQL date functions.

```nolang

"parameters":{
    "source":"Opportunity_Data",
    "mergeWithSource":true,
    "computedFields":[ {
        "name":"UIFormattedDate",
        "type": "Text",
        "saqlExpression":"date_to_string(toDate(Date_sec_epoch), "yyyy-MM-dd")" } ] }}
```

**See Also**

- [Simple case Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-case.md)
- [computeExpression Transformation](https://help.salesforce.com/s/articleView?id=bi_integrate_saql_transformation.htm)
