This article shows how to analyze an apparel company's sales data to help plan business strategies for the next fiscal year. You will learn how to use the DataV-Note (intelligent analysis) platform to perform data analysis, create visualizations, and generate an analysis report that you can export or share.
Prerequisites
Before you begin, complete the following prerequisites:
Download the sample data
This tutorial uses simulated sales performance data from an apparel company. The data includes fields such as sales date, sales amount, region, gross profit, and category, describing the company's overall sales performance in various regions during the current fiscal year. You will analyze this data to formulate business strategies for the next fiscal year. Click Apparel Company Sales Data to download the sample data to your computer, and rename the file to apparel_analysis_data.csv.
Activate DataV-Note
You will use DataV-Note for the analysis. To activate the service, see Activate DataV-Note (intelligent analysis).
(Optional) Create a workspace
A workspace in DataV-Note manages business data, member permissions, and projects. If you need to manage different types of business data, you can create multiple workspaces to keep your data isolated. After you activate DataV-Note, the platform provides a ready-to-use default workspace. This tutorial uses the default workspace to perform all operations. You can also create a new workspace as needed. For more information, see Create a workspace.
(Optional) If you use a RAM account for development, you must add it as a workspace member and grant the necessary permissions. For more information, see Add a member and grant permissions.
Step 1: Create a project
A project is the basic unit for organizing data analysis in DataV-Note.
Log on to the DataV-Note console.
In the left navigation pane, click Create Project, and then enter a project title and description.
For this tutorial, the project title is Apparel Company Sales Analysis. You can customize the title as needed.
Click OK to create the project.
After the project is created, you are automatically taken to the project editing page to import and analyze data.
Step 2: Import data
Import the sample data file that you downloaded in the prerequisites step (apparel_analysis_data.csv) into your project for analysis.
On the Dataset (
icon) tab, click the
icon and follow the on-screen instructions to upload the file. After the data is imported, it is stored under File Dataset.
Step 3: Analyze data
After the data is imported, you can analyze the data based on your business needs.
Note DataV-Note automatically adapts to the syntax of your selected data source. The data in this tutorial uses DuckDB syntax.
In DataV-Note, all data analysis statements are run in an analysis cell. For more information about analysis cells, see Supported analysis cell types.
In this tutorial, you will first generate a query result set from an overview of the sales data. You will then use this set to perform further analysis from different perspectives, such as sales ranking by region, sales trends by region, sales ranking by category, sales trends by category, gross profit ranking by region, and gross profit ranking by category. This helps you evaluate sales performance across both region and category dimensions.
Generate result set
Follow these steps to view an overview of the sales data and generate a query result set named retail. You will use this result set for subsequent analysis.
Create an SQL analysis cell.
Click the
icon next to apparel_analysis_data.csv and select Create SQL Query. The platform automatically creates an analysis cell, generates an SQL statement to view the CSV file, and displays the results. 
Sample code:
SELECT * FROM "apparel_analysis_data.csv"
Analyze the query results.
In the analysis cell, follow the steps in the figure below to view sales from different perspectives and identify high-value data. For example, you can see that the sales contribution of lifestyle stores is higher than that of fashion stores, and the best-selling category is men's accessories.
Rename the query result set.
Click the name of the output query result set and rename it to retail. This makes it easier to write SQL for subsequent analysis operations.
Sales rankings by region
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View sales rankings by region.
Using the retail query result set, query and calculate the sales for each region, then sort the results in descending order by total sales.
Example: Alias the region column as Region, calculate the sum of sales for each region and alias the result column as total_sales, then sort the results in descending order by total sales.

Sample code:
SELECT "region" AS "Region", SUM("sales_amount") AS total_sales FROM retail GROUP BY "Region" ORDER BY total_sales DESC
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a clustered column chart and sort the results by total sales in descending order. Also, update the chart title and description.
Chart title: Change to Sales Rankings by Region.
Sample chart description: The sales rankings by region across the country show that Shanghai is number one. Shanghai is one of China's most developed cities, with high per capita income and consumption levels. Male consumers there have higher purchasing power and are more likely to buy branded or high-end menswear. Shanghai may also have a proportionally larger population of professional men who require formal or business casual work attire. Sales in the Shanghai market alone exceed the combined sales of the Northeast, South Central, and Northwest regions. We recommend continuing to focus investment in this area.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Sales trends by region
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View sales trends by region.
Using the retail query result set, query and calculate the sales trends for different regions.
Example: Alias the sales_date column as Date and the region column as Region. Calculate the sum of sales for each region on each date and alias the result column as total_sales. Then, group the results by date and region.
Sample code:
SELECT "sales_date" AS "Date", "region" AS "Region", SUM("sales_amount") AS total_sales FROM retail GROUP BY "Date", "Region"
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a line chart and display the total sales by date and region. Also, update the chart title and description.
Chart title: Change to Sales Trends by Region.
Sample chart description: The data for 2017 shows a significant sales drop in the North China region in July. This corresponds with a period of heavy summer rainfall that year, which likely impacted people's ability to go out and shop, thus affecting apparel sales.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Sales rankings by category
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View sales rankings by category.
Using the retail query result set, query and calculate the sales for each product category, then sort the results in descending order by total sales.
Example: Alias the category_description column as Category, calculate the sum of sales for each category and alias the result column as total_sales, then sort the results in descending order by total sales.

Sample code:
SELECT "category_description" AS "Category", SUM("sales_amount") AS total_sales FROM retail GROUP BY "Category" ORDER BY total_sales DESC
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a clustered column chart and sort the results by total sales in descending order. Also, update the chart title and description.
Chart title: Change to Sales Rankings by Category.
Sample chart description: In terms of sales categories, the company's traditionally strong "Men's Accessories" category remains number one. The "Children's Clothing" category, added last year, has grown rapidly, ranking among the top three by 2017.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Sales trends by category
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View sales trends by category.
Using the retail query result set, query and calculate the sales trends for different product categories.
Example: Alias the sales_date column as Date and the category_description column as Category. Calculate the sum of sales for each category on each date and alias the result column as total_sales. Then, group the results by date and category.

Sample code:
SELECT "sales_date" AS "Date","category_description" AS "Category", SUM("sales_amount") AS total_sales FROM retail GROUP BY "Date", "Category"
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a line chart and display the total sales by date and category. Also, update the chart title and description.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Gross profit rankings by region
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View gross profit rankings by region.
Using the retail query result set, query and calculate the gross profit for each region, then sort the results in descending order.
Example: Alias the region column as Region, calculate the sum of gross profit for each region and alias the result column as total_profit, group the results by region, then sort in descending order by the total profit.

Sample code:
SELECT "region" AS "Region", SUM("gross_profit") AS total_profit FROM retail GROUP BY "Region" ORDER BY total_profit DESC
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a clustered column chart and sort the results by gross profit in descending order. Also, update the chart title and description.
Chart title: Change to Gross Profit Rankings by Region.
Sample chart description: The gross profit rankings across all regions show that Shanghai is number one. This aligns with our previous analysis, which found that the Shanghai region had the highest sales performance and also generates the highest gross profit.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Gross profit rankings by category
In the project interface, follow the steps in the figure to create a new SQL analysis cell and select Query Result Set as the data source.
View gross profit rankings by category.
Using the retail query result set, query and calculate the gross profit for each category, then sort the results in descending order.
Example: Alias the category_description column as Category, calculate the sum of gross profit for each category and alias the result column as total_profit, group the results by category, then sort in descending order by the total profit.

Sample code:
SELECT "category_description" AS "Category", SUM("gross_profit") AS total_profit FROM retail GROUP BY "Category" ORDER BY total_profit DESC
Visualize the query results.
Click the
icon in the SQL analysis cell to switch to the chart view.
Click More Configurations on the left side of the chart to open the chart editing page.
Configure the chart style.
For this example, change the chart type to a clustered column chart and sort the results by gross profit in descending order. Also, update the chart title and description.
Chart title: Change to Gross Profit Rankings by Category.
Sample chart description: The high gross profit from menswear is due to our company's positioning in the high-end market. The premium pricing of these products highlights their high quality, brand value, and uniqueness, which in turn allows for a higher gross profit margin.
Note DataV-Note automatically recommends a chart type based on your query. If the recommended style matches the one in this tutorial, you can skip the style-setting steps (labeled 1 to 3 in the figure).
Double-click the chart title or description to edit them.

Based on the preceding analysis, we can draw the following conclusions:
Compared to the same period last year, the company's sales show a steady growth trend, and gross profit has also increased, indicating a healthy business condition. The relatively stable gross profit margin suggests that cost control is effective and the product pricing strategy is sound.
The company's sales performance shows positive trends, especially in certain high-growth regions and brands. However, there is still room for improvement, including sales strategies in some regions, product diversification, and expansion into emerging markets. We recommend increasing investment in high-growth regions and brands and developing specific improvement measures for underperforming regions and categories. At the same time, the company should closely monitor changes in the competitive landscape and flexibly adjust its market strategy to maintain a competitive edge.
Step 4: Generate an analysis report
After you complete the analysis, you can publish the project as an analysis report to export or share.
In the upper-right corner of the analysis page, click Preview & Publish to generate a visualized analysis report.
On the report page, click the
icon in the upper-right corner to export the report in a specific format or share it to a desired application.
Note Export: You can only export the analysis report as a JPG image or a PDF file.
Share: You can only share the analysis report to email, DingTalk, or WeChat. Alternatively, you can share the report's link after publishing.
