# Frequency

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

<figure><img src="/files/g1aak8L4wOBucvV9HLjb" alt=""><figcaption></figcaption></figure>

### Name of Visualization

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

<figure><img src="/files/IRCSczc1E5IOEGxhJpy3" 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="/files/7zJS68Tp6ZfRGsfRGT9l" 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="/files/7qtfkktgmTZx18YDDOd4" 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="/files/5wCmmelAXMZeLUIgPmeQ" 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="/files/CX3uTNpX5BzS068M6xlx" 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="/files/87m4sQdlz587TcDLPLUX" 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="/files/pi2O16uI4eODPoAD4ueU" 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="/files/jEV0X6EalMBqlrzCBJ1l" 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="/files/H5LOB1tipLo2NrFeiXIv" 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="/files/8UnN861dN77sFJ6GqHku" 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="/files/X8Xx49uFySTxJTbiHd4U" 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="/files/AXV0R2Vae6ZqoHOG03eU" 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="/files/0srex2zQDiogj4mRTI88" 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="/files/3G2Y3OXbuS9Wys7L6gk5" 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="/files/78bahtCbDCodTyKhRhiB" 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="/files/nCDvKPuz1J0w0lTlieoA" 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="/files/nyKepsoAYNKELB8OaGFR" 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="/files/AMxX2eaLPAYdC9QINGBD" 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="/files/VuxJVxNUgJaKAiUox10p" 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="/files/wsX0YaQm3kDm1p7TNrJm" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.apxor.com/product-guides/bi-dashboard/frequency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
