A dataset contains information about leads, deals, companies, and other Bitrix24 items. Each item has several datasets that automatically receive data from system and custom fields. Use datasets to create charts and analyze business efficiency metrics.
In this article, you'll learn about datasets for products, how to merge them, and how to create charts.
Datasets:
- crm_product — products
- crm_product_property — product properties
- crm_product_property_value — product property values
Examples:
Choose a dataset
To analyze information in a dashboard, choose a suitable dataset and create a chart.
crm_product — products. This dataset contains data from system fields for products and services in the CRM catalog, including names, types, sections, prices, and more. Use this dataset to analyze the product and service catalog.
crm_product
| Field | Description | Data type |
|---|---|---|
| ID | Product or service ID | Number |
| NAME | Product or service name | String |
| TYPE | Product or service type | String |
| PARENT_ID | ID of the parent product for the SKU | Number |
| SECTION_ID | ID of the main catalog section the product or service belongs to | Number |
| SECTION_NAME | Name of the main catalog section the product or service belongs to | String |
| MEASURE | Unit of measurement for the product or service | String |
| PRICE | Base price of the product or service | Number |
| PURCHASING_PRICE | Purchasing price of the product or service from the product form | Number |
| PURCHASING_CURRENCY | Currency code of the purchasing price | String |
crm_product_property — product properties. This dataset contains data from system fields for product and service properties in the CRM catalog: property IDs and names. Use this dataset to identify which characteristics products and services have.
crm_product_property
| Field | Description | Data type |
|---|---|---|
| ID | Product or service property ID | Number |
| NAME | Product or service property name | String |
crm_product_property_value — product property values. This dataset contains data from system fields for product and service property values: links between products and properties, codes, and values. Use this dataset to analyze product and service characteristics.
crm_product_property_value
| Field | Description | Data type |
|---|---|---|
| ID | Property value record ID | String |
| PROPERTY_ID | Product or service property ID | Number |
| PRODUCT_ID | Product or service ID | Number |
| VALUE | Product or service property value. For a property of the List type — ID of the selected option | String |
| VALUE_NAME | Product or service property value. For a property of the List type — name of the selected option; for text properties, same as VALUE |
String |
Create a chart
Add information from a dataset to charts and track business metrics. For example, check sales volume or see which products sell more often.
- Open BI Builder > Charts.
- Click + Chart in the top-right corner.
- Choose a dataset from the list. If you do not see the dataset you need, click Add a dataset.
Create a dataset - Choose a chart type — the format for viewing the information, such as a card, table, line chart, or another option.
- Click Create new chart.
Merge datasets
Merge datasets to include information from system and custom product fields in a report and see which properties products have.
- Open BI Builder > SQL > SQL Lab.
- Make sure
bitrix24is selected in the Schema field. - Enter the SQL query and click Run.
- Review the query results. To create a chart for a report, save the query as a dataset. The dataset receives data from the fields specified in the SQL query.
Create a chart from a virtual dataset
If this is your first time merging datasets, see the sample query.
Example SQL query
This SQL query extracts data from three datasets: products (crm_product), product properties (crm_product_property), and product property values (crm_product_property_value). You can copy it to see how the query works. The query selects all products with the Color property and shows their values.
SELECT
crm_product.ID AS "Product ID",
crm_product.NAME AS "Product name",
crm_product_property.NAME AS "Product property name",
crm_product_property_value.VALUE_NAME AS "Property value"
FROM
crm_product
JOIN
crm_product_property_value ON crm_product.ID = crm_product_property_value.PRODUCT_ID
JOIN
crm_product_property ON crm_product_property_value.PROPERTY_ID = crm_product_property.ID
WHERE
crm_product_property.NAME = 'Color';
SELECT determines which information to extract from the dataset. For example, the query SELECT crm_product.ID AS "Product ID":
- Selects the product ID
IDfrom thecrm_productdataset - Assigns it the name
Product ID - Displays the result in a separate table column
FROM specifies the main dataset that the data comes from. In this example, it is crm_product, the table with product information.
JOIN links the crm_product table to crm_product_property_value by product ID. The query connects each product to its properties.
JOIN links the crm_product_property_value table to crm_product_property by product property ID. The query connects property values to property names.
WHERE filters the results and shows only products with the Color property. You get a list of products by color. To filter by a specific color, add: AND crm_product_property_value.VALUE_NAME = 'red';. This shows only red products.
In brief
- A dataset contains information about leads, deals, companies, and other Bitrix24 items.
- Each item has several datasets that automatically receive data from system and custom fields.
- Products have three datasets: products (crm_product), product properties (crm_product_property), and product property values (crm_product_property_value).
- Use datasets to create charts and analyze business efficiency metrics. Charts can show sales volume and the most popular products.
- Merge datasets to include information from system and custom product fields in a report and see which properties products have. Write an SQL query, save the result as a dataset, and create a chart.