# Building a Report with a ClickHouse Data Connector

{% hint style="warning" %}
**Prerequisites:**

* Access to the **Data Center** and **Report Modules**.
* ClickHouse connection details: **Host**, **Port**, **HTTP Port**, **Username**, **Password**, **Database Name (dbname)**, and **SSL Type**.
* A valid SQL query you can run against your ClickHouse database.
  {% endhint %}

***

### Phase 1 — Create a ClickHouse Data Connector

1. Open the **Apps** menu → go to **Data Center**.
2. In **Data Connectors**, click **Create +**.
3. Choose **ClickHouse** as the connector type.
4. Enter:
   * **Name**: `Workflow 2` (and optional **Description**)
   * **Credentials**: **Host**, **Port**, **HTTP Port**, **Username**, **Password**, **Database Name (dbname)**
   * **SSL Type**
5. Click **Save**.

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

* [x] You’ll see a confirmation that the Data Connector was created successfully.

### Phase 2 — Create a Data Store on the Connector

1. From the newly created connector’s **⋯ (three dots)** menu, select **Create Data Store**.
2. **Name** the Data Store: self\_service\_02.
3. **Query**: Paste/write the SQL that defines your dataset → click **Next**.

   <figure><img src="/files/wzjysrpa0ejthUdEplU4" alt=""><figcaption></figcaption></figure>
4. **Dimensions & Measures**:
   * Set the **Expected Joining Date** as the **Time Field**.
   * Set **Expected CTC** as a **Measure**.
   * Click **Next.**
5. **Hierarchy Definition**:
   * **Drill Definition (time)**: Add **Expected Joining Date**.
   * **Drill Definition 1**: Add **Source**, **Skills**, **Team**, **Designation**.
   * Click **Next** → **Finish**.

* [x] The Data Store is created and visible in the list.

### Phase 3— Create a Business Report from the Data Store

1. Open **Apps** → **Report Module**.
2. **Create Report**:
   * Name: e.g., `Workflow 2` (add a Description if desired).
   * Select the `workflow2` Data Store → click **Create Report**.

#### View 1 — Total Offered CTC by Skill (Mixed Chart)

1. Choose **Mixed Chart**.
2. Drag **Skill** (dimension) and **Offered CTC** (measure) onto the chart.
3. Customize: sorting/order-by, bar size, display names.
4. Rename the view → **Save**.

#### View 2 — Team-wise Total Experience (Pie)

1. Choose **Pie Chart**.
2. Drag **Team** (dimension) and **Experience** (measure).
3. Order by **Team** (ascending).
4. Rename the view → **Save**.

#### View 3 — Previous History of Employees (Data Grid)

1. Choose **Data Grid**.
2. Drag dimensions **Name**, **Previous Organization**; measure **Previous CTC**.
3. Sort **Name** ascending; update column display names.
4. Rename the view → **Save**.

#### View 4 — Team-wise Offered CTC (Treemap)

1. Choose **Treemap Chart**.
2. Drag **Team** (dimension) and **Offered CTC** (measure).
3. Order by **Team** (ascending).
4. Rename the view → **Save**.

#### View 5 — Monthly Salary by Designation (Mixed Chart)

1. Choose **Mixed Chart**.
2. Drag **Designation** (dimension) and **Monthly Salary** (measure).
3. Sort **Designation** ascending; set record limits and bar size.
4. Rename the view → **Save**.

#### View 6 — Compare Avg Previous CTC vs Offered CTC (Mixed Chart)

1. Choose **Mixed Chart**.
2. Drag **Previous Organization** (dimension); measures **Previous CTC** and **Offered CTC**.
3. Sort/order by **Previous Organization**, set limits, and bar size.
4. Rename the view → **Save**.

***

### Phase 4 — Add Advanced Analysis

#### Timeline Play (dynamic time playback)

1. In the right pane, click **Analyse → Timeline Play**.
2. Set **Time Dimension** (e.g., Expected Joining Date), **Interval** = Monthly, **Start/End** dates, and **Delay**.
3. **Start** Timeline Play to animate charts over time.

#### Interactions (cross-filtering between views)

1. In the right pane, click **Edit → Interaction**.
2. Enable **Interactions** and select the target charts to link.
3. **Save** the view.
   * Example: Clicking a **Skill** updates the **Total Offered CTC by Team** chart.

#### Drill-Through (Monthly Salary by Joining Date)

1. Create a chart with **Monthly Salary** (measure) and **Expected Joining Date** (dimension).
2. Sort by **Joining Date** ascending → rename the view → **Save**.
3. Double-click the view, select a bar, and choose **Drill Through**.
   * All months display; click a month to view detailed dates.

     <figure><img src="/files/8XsmzG6nkCPXiEAfbNVQ" alt=""><figcaption></figcaption></figure>

### Outcome

You have:

* A ClickHouse **Data Connector**
* A production-ready **Data Store** (`workflow2`)
* A multi-view **Business Report** with Timeline Play, Interactions, and Drill-Through enabled

Use **Save** frequently and adjust chart properties (labels, legends, colors) to meet your presentation standards.


---

# 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://docs.bdb.ai/bdb-user-documentation/platform-modules/10.0/how-to-guides-and-tutorials/self-service-report/building-a-report-with-a-clickhouse-data-connector.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.
