# Trends

This visualization displays changes over time, helping to identify patterns and forecast future values.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FtW5mIA4wuEmMc6LWF65A%2Fimage.png?alt=media&#x26;token=d8e958e0-ba14-4f82-bbc9-97d53176f22e" alt=""><figcaption></figcaption></figure>

### Data Visualization <a href="#name-of-visualization" id="name-of-visualization"></a>

Enter the following values as required to plot the trend.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FstfzIJOc4TUY8bLEWOcE%2Fimage.png?alt=media&#x26;token=faee488c-9e23-45f2-98e1-65a047b0379b" alt=""><figcaption></figcaption></figure>

### Name of Visualization <a href="#name-of-visualization" id="name-of-visualization"></a>

Enter the name of your Visualization widget, which will appear on your dashboard.

### Alias for Metric

Enter the name for each metric, which will appear on your dashboard.

### Granularity

You can choose the granularity for plotting the trend graph as either Day or Hour.

### Metrics

Select the column name from the dropdown for which you want to get the trend.

### Expression Builder

Start typing the function you want to use and select it from the suggestions. Then, place the cursor inside the brackets and type the property name you selected in Properties as the function parameter for calculations. The aggregate function will be applied on the output of this expression builder.

The following options are available in the Expression Builder. `Ci` represents the attributes/properties selected by you

{% tabs %}
{% tab title="Arithmetic Functions" %}

<table><thead><tr><th width="172">Function</th><th width="287">Attribute Structure</th><th>Usage</th></tr></thead><tbody><tr><td>sum()</td><td>(attribute)</td><td>sum(C1)</td></tr><tr><td>sumIf()</td><td>(attribute, filter)</td><td>sumIf(C1, conditions)</td></tr><tr><td>avg()</td><td>(attribute)</td><td>avg(C1)</td></tr><tr><td>avgIf()</td><td>(attribute, filter)</td><td>avgIf(C1, conditions)</td></tr><tr><td>count()</td><td>(attribute)</td><td>count(C1)</td></tr><tr><td>countIf()</td><td>(attribute, filter)</td><td>countIf(C1, conditions)</td></tr><tr><td>uniq()</td><td>(attribute)</td><td>uniq(C1)</td></tr><tr><td>uniqIf()</td><td>(attribute, filter)</td><td>uniqIf(C1, conditions)</td></tr><tr><td>min()</td><td>(attribute)</td><td>min(C1)</td></tr><tr><td>max()</td><td>(attribute)</td><td>max(C1)</td></tr><tr><td>least()</td><td>(attribute1, attribute2)</td><td>least(C1, C2)</td></tr><tr><td>greatest()</td><td>(attribute1, attribute2)</td><td>greatest(C1, C2)</td></tr><tr><td>date_diff()</td><td>(return type, attribute1, attribute2)</td><td>date_diff('second', C1, C2)</td></tr></tbody></table>
{% endtab %}

{% tab title="Operators" %}

<table><thead><tr><th width="125" align="center">Operator</th><th>Action</th><th>Example Usage</th></tr></thead><tbody><tr><td align="center">+</td><td>Addition</td><td>uniq(C1) + uniq(C2)</td></tr><tr><td align="center">-</td><td>Subtraction</td><td>uniq(C1) - uniq(C2)</td></tr><tr><td align="center">/</td><td>Division</td><td>uniq(C1) / uniq(C2)</td></tr><tr><td align="center">*</td><td>Multiplication</td><td>uniq(C1) * uniq(C2)</td></tr></tbody></table>
{% endtab %}

{% tab title="Numeric Transformations" %}

<table><thead><tr><th width="122">Function</th><th width="346">Description</th><th>Usage</th></tr></thead><tbody><tr><td>abs()</td><td>Return the absolute value of a number</td><td>abs(C1)</td></tr><tr><td>toInt8()</td><td>Converts a value to an 8-bit integer</td><td>toInt8(C1)</td></tr><tr><td>toInt16()</td><td>Converts a value to an 16-bit integer</td><td>toInt16(C1)</td></tr><tr><td>toInt32()</td><td>Converts a value to an 32-bit integer</td><td>toInt32(C1)</td></tr><tr><td>toInt64()</td><td>Converts a value to an 64-bit integer</td><td>toInt64(C1)</td></tr><tr><td>toString()</td><td>Converts a value to a string</td><td>toString(C1)</td></tr></tbody></table>
{% endtab %}

{% tab title="Transformations" %}

<table><thead><tr><th width="193">Function</th><th width="269">Description</th><th>Usage</th></tr></thead><tbody><tr><td>toTimeStamp()</td><td>Converts a value to timestamp</td><td>toTimeStamp(C1)</td></tr><tr><td>toWeekDay()</td><td>Converts a date to the corresponding day of the week</td><td>toWeekDay(C1)</td></tr><tr><td>toUTCHour()</td><td>Converts a time to its UTC Hour</td><td>toUTCHour(C1)</td></tr><tr><td>toMonth()</td><td>Converts a date to its corresponding month</td><td>toMonth(C1)</td></tr><tr><td>toDate()</td><td>Converts a value to a date format</td><td>toDate(C1)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Custom Filters

You can filter the data in the final output on the dashboard according to your needs.

Choose whether to include data using the **=** operator or exclude it using the **!=** operator. You can also use the regex operator and provide the regex formula.

### Customize

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FRCOBcVCrjk1U24LTGhvo%2Fimage.png?alt=media&#x26;token=3e3a14df-c5cc-4005-9dd0-3e080e746db3" alt=""><figcaption></figcaption></figure>

**Color:** You can customize the color for the graph.

**Graph Type:** You can select between area and line graph.

**Font Size:** You can customize the font size for Value and Unit.

**Font Color:** You can customize the font color for Value and Unit.

**Trend value type:** You can select one of the following trend value types.

1. Average
2. Median
3. Min
4. Max
5. Sum

**Dimension Units:**

Select the unit from the dropdown to be displayed on the dashboard.

Following unit options are available

{% tabs %}
{% tab title="Time" %}
Second = sec

Minutes = mins

Hours = hrs

Days = days

Week = week
{% endtab %}

{% tab title="Numbers" %}
Thousand = K

Lakh = L

Million = M

Billion = B
{% endtab %}
{% endtabs %}

### View Chart

Click on View Chart to preview it before adding it to the dashboard.
