# 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](/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)
