# Frequency

This visualization is used to visualize how often each category occur, highlighting patterns and anomalies in the dataset.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FnTJrsK563WXXnXojdfXs%2Fimage.png?alt=media&#x26;token=ba152c02-d792-4b8f-843d-3308b366caef" alt=""><figcaption></figcaption></figure>

### Name of Visualization

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

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FcxmQlMT0ABzOo8Bo5Fuh%2Fimage.png?alt=media&#x26;token=8c02a3d1-9eb8-4f00-b27b-9dfabb8ad932" alt=""><figcaption></figcaption></figure>

### X-Axis Property

Select your preferred column name from the dropdown. The data from this column will populate the x-axis values to create a frequency visualization.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FLQl7ZYm03rJRlmEMIp9u%2Fimage.png?alt=media&#x26;token=6b1ea87f-64e2-405c-8788-4a563cef15bd" alt=""><figcaption></figcaption></figure>

### Alias for X-Axis

Enter the alias you want to display for the X-axis on the visualization graph.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FCSTE0HuEHCXab0xqadaO%2Fimage.png?alt=media&#x26;token=bfab76f2-1e4a-487f-846e-19b94013996e" alt=""><figcaption></figcaption></figure>

### Y-Axis Property

Click on the + icon next to Y-Axis Properties to add properties for calculating values on the Y-axis. You can add more than one property here.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FFOXWDK2ocpsng3ciEK3b%2Fimage.png?alt=media&#x26;token=9b53da2f-67a5-44a8-8232-344643e62712" alt=""><figcaption></figcaption></figure>

### Alias for Y-Axis

Enter the alias you want to display for the Y-axis on the visualization graph.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FzdulXUvMnVWC3pFsB2Gb%2Fimage.png?alt=media&#x26;token=e9163008-1536-44bc-808b-4dc0f5c52cbe" alt=""><figcaption></figcaption></figure>

### Expression Builder

You can write an expression here to calculate the value for Y-Axis.

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 Y-Axis Properties as the function attribute for calculations.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FaOzno4jB7uBtRdm2f0m0%2Fimage.png?alt=media&#x26;token=c5bc2b7e-72cf-460c-b03e-febf5c466c6c" alt="" width="375"><figcaption></figcaption></figure>

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" %}

| Function      | Description                                          | Usage           |
| ------------- | ---------------------------------------------------- | --------------- |
| toTimeStamp() | Converts a value to timestamp                        | toTimeStamp(C1) |
| toWeekDay()   | Converts a date to the corresponding day of the week | toWeekDay(C1)   |
| toUTCHour()   | Converts a time to its UTC Hour                      | toUTCHour(C1)   |
| toMonth()     | Converts a date to its corresponding month           | toMonth(C1)     |
| toDate()      | Converts a value to a date format                    | toDate(C1)      |
| {% endtab %}  |                                                      |                 |
| {% endtabs %} |                                                      |                 |

## sum()

The `sum()` function is used to calculate the total sum of a numeric column.

**Example:** Calculate the **total sales revenue** from all orders in the E-commerce application.

For example: Calculate the **total sales revenue** from all orders in the E-commerce application. Here A represents  the **sales\_revenue** as a property&#x20;

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FSbUjxXcDYrwJ16lPfGMb%2Fimage.png?alt=media&#x26;token=bbea18d0-cb25-44df-a8ce-0b80470043e8" alt=""><figcaption></figcaption></figure>

## sumIf()

The `sumIf()` function calculates the total sum of a numeric column, but **only for rows that meet a specified condition**. It works similarly to`sum()`, but adds a filtering condition.

**Example:** Calculate the **Total Sales Revenue** for **Failed transactions** in **Hyderabad** in an E-commerce Application

In this case, we want to calculate the total **sales revenue** (`A`) for transactions that **failed** (`B = 'FAIL'`) and are located in **Hyderabad** (`C = 'hyderabad'`).

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FEjHGloQzQIs33VuCCuwz%2Fimage.png?alt=media&#x26;token=1c46819e-c96f-4fa8-a852-bada86e8a00b" alt=""><figcaption></figcaption></figure>

## avg()

The `avg()` function is used to calculate the **average value** of a numeric column.

**Example:** Calculate the **Average Sales Revenue** from All Orders in an E-commerce Application

In this case, we want to calculate the average sales revenue from all transactions. Here, `A` represents the **sales\_revenue** as a property.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FvDdVaUyw7UhVT8bYUE0a%2Fimage.png?alt=media&#x26;token=78402ba8-9db5-4ee3-8c8b-c9fca5584e2c" alt=""><figcaption></figcaption></figure>

## avgIf()

The `avgIf()` function is used to calculate the **average value** of a numeric column based on a specified condition.

**Example:** Calculate the **Average Sales Revenue** for Failed Transactions in Hyderabad.

In this case, we want to calculate the average sales revenue from transactions that failed and are located in Hyderabad. Here, `A` represents **sales\_revenue**, `B` represents **transaction\_status**, and `C` represents **location**.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FIP79OQyYAE2ZFSUb5pxX%2Fimage.png?alt=media&#x26;token=4f977780-90ad-48ff-b133-7c307c597b1e" alt=""><figcaption></figcaption></figure>

## count()

The `count()` function is used to **count the number of rows** or occurrences of a specific value in a column.

**Example:** Calculate the **Total Number of Transactions** in an E-commerce Application

In this case, we want to count the total number of transactions processed in the application. Here, `A` represents the **transaction\_id** as a property.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FdnbYYTaB2UqyS5nQLeQq%2Fimage.png?alt=media&#x26;token=a8546362-6ea1-49c7-9a7b-a9b86170f016" alt=""><figcaption></figcaption></figure>

## countIf()

The `countIf()` function is used to count the number of rows that meet a specified condition.

**Example:** Calculate the **Total Number of Failed Transactions** in **Hyderabad**

In this case, we want to count the total number of transactions that have failed and are located in Hyderabad. Here, `A` represents **transaction\_status** and `B` represents **location**.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2F8DojZ1AjaYtaFmuEOXfU%2Fimage.png?alt=media&#x26;token=0e6a1ced-cd0d-4c74-812b-d7f797ea1f2a" alt=""><figcaption></figcaption></figure>

## uniq()

The `uniq()` function is used to calculate the **number of distinct values** in a specified column.

**Example:** Calculate the **Total Number of Unique Customers** in the E-commerce Application

In this case, we want to count the total number of unique customers who have made purchases. Here, `A` represents the **customer\_id** as a property.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FORaAk510iGLWnNNv23oL%2Fimage.png?alt=media&#x26;token=d714215c-c204-49be-bea9-660b49fd5b48" alt=""><figcaption></figcaption></figure>

## uniqIf()

The `uniqIf()` function is used to count the **number of distinct values** in a column, but **only for rows that meet a specific condition**.

**Example:** Calculate the **Number of Unique Customers** Who Had **Failed Transactions** in **Hyderabad**

In this case, we want to calculate the total number of **unique customers** who experienced **failed transactions** and are located in **Hyderabad**. Here, `A` represents **customer\_id**, `B` represents **transaction\_status**, and `C` represents **location**.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FA4ZKhx9ZVxOW8YUabrS9%2Fimage.png?alt=media&#x26;token=ea121320-bf33-464a-8227-d9f2ce506536" alt=""><figcaption></figcaption></figure>

## min()

The `min()` function is used to calculate the **minimum value** in a numeric column.

**Example:** Calculate the **Minimum Sales Revenue** from All Orders in an E-commerce Application

In this case, we want to find the minimum sales revenue from all transactions. Here, `A` represents the **sales\_revenue** as a property.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2F1FUOn4mxZBbQIomJ8JDh%2Fimage.png?alt=media&#x26;token=57379d69-9381-46a7-8f93-4ca3ac362d31" alt=""><figcaption></figcaption></figure>

## max()

The `max()`function is used to calculate the **minimum value** in a numeric column.

**Example:** Calculate the **Minimum Sales Revenue** from All Orders in an E-commerce Application

In this case, we want to find the maximum sales revenue from all transactions. Here, `A` represents the **sales\_revenue** as a property.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FqafFp8NJGzEGuKtQKiQF%2Fimage.png?alt=media&#x26;token=d9b6fa85-60f2-46e1-a3a2-595c933a5986" alt=""><figcaption></figcaption></figure>

## least()

The `least()` function is used to return the **smallest value** from a set of values across multiple columns or expressions.

**Example:** Calculate the **Least Value Between Sales Revenue** and **Discount Amount for Each Order** in an E-commerce Application

In this case, we want to find the smallest value between the **sales revenue** (`A`) and **discount amount** (`B`) for each order. Here, `A` represents **sales\_revenue** and `B` represents **discount\_amount** as properties.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FL6TwpJGMzL1o7F0gGrOZ%2Fimage.png?alt=media&#x26;token=d51f17b6-b787-48f0-b498-d6a3c2ca0597" alt=""><figcaption></figcaption></figure>

## greatest()

The `greatest()` function is used to return the **largest value** from a set of values across multiple columns or expressions.

**Example:** Calculate the **Greatest Value** Between **Sales Revenue** and **Discount Amount** for Each Order in an E-commerce Application

In this case, we want to find the largest value between the **sales revenue** (`A`) and **discount amount** (`B`) for each order. Here, `A` represents **sales\_revenue** and `B` represents **discount\_amount** as properties.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2F4hCOkeS6mahHPTyezyGH%2Fimage.png?alt=media&#x26;token=c0d0ee1c-c078-42cb-9c0a-1fa6555ad09e" alt=""><figcaption></figcaption></figure>

## date\_diff()

The `date_diff()` function is used to calculate the **difference between two dates** in a specified unit (such as days, months, or years).

**Example:** Calculate the **Number of Days** Between **Order Date** and **Delivery Date** in an E-commerce Application

In this case, we want to calculate the number of days between the **order date** (`A`) and the **delivery date** (`B`). Here, `A` represents the **order\_date** and `B` represents the **delivery\_date** as properties.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FREarTPqkVyEWH64brcw9%2Fimage.png?alt=media&#x26;token=76288014-e01c-4f25-acaf-07f338a0922e" alt=""><figcaption></figcaption></figure>

### 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.

<figure><img src="https://300211688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQuYbJ9bg7CFtrBaVp9pB%2Fuploads%2FAggStOWzcxazUGaNJIYr%2Fimage.png?alt=media&#x26;token=7e281183-ab0b-4823-8b28-fe84171a033f" alt=""><figcaption></figcaption></figure>

### Customize

You can customize the colors and add units to both the axes.

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.
