The DataAnalysis module in DataWorks provides a data visualization tool that displays processed data in charts to help you quickly extract key information. This topic uses an example to demonstrate how to visualize user persona data in DataWorks.
Prerequisites
Before you begin, make sure that you have processed the data using DataWorks DataStudio to transform the data into basic user persona data.
Use cases
This example visualizes and analyzes user persona data for the following scenarios:
Scenario | Chart |
Numbers of registered members in different provinces and cities |
|
Distribution of member page views by age |
|
Distribution of page views of members by gender |
|
Numbers of page views of members counted by gender and zodiac sign |
|
Go to the SQL Query page
This example uses the SQL Query feature in DataAnalysis.
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, click Go to DataAnalysis. In the left-side navigation pane of the page that appears, click SQL Query.
Configure a data source for an SQL query
Grant permissions on a Data Source.
Before you can use a data source in DataAnalysis, you must grant permissions to it. Go to . Find the data source that you want to query. In the Operation column, click Authorization to grant permissions to your account. For more information, see Security Center.
Create a temporary file.
Method 1: If you are on the SQL Query page for the first time or no SQL file is open, click Create SQL Query to create a temporary File.
Method 2: If an SQL file is already open, click the
icon to create a temporary File.
NoteFor more information about how to create an SQL query, see SQL Query (Legacy).
Select Data Source.
On the edit page of the temporary file, select the workspace, engine type, and data source for the query. This example uses a MaxCompute data source.
Write SQL commands
On the edit page of the temporary file, enter the following SQL statement and click the
icon to query data from the ads_user_info_1d table. In this example, the partition is specified as dt="20241126".
-- If the target partition is not found, run the show partitions tablename command to confirm the table partitions.
select * from ads_user_info_1d where dt='data timestamp';View query results and modify charts
After the query is complete, click the
icon in the navigation pane to the left of the results to visualize the data. You can also click the
icon in the upper-right corner of the chart to open the chart editor and modify the chart.

Numbers of registered members in different provinces and cities
Double-click the default title above the chart and enter a new title.
Style settings.
In the right-side panel, choose .
Data settings.
In the left-side panel, click Data. Set the X-axis field to Count (Distinct Count) and the Y-axis field to region.
Drag the uid field to X-axis. From the X-axis drop-down list, choose .
Drag the region field to Y-axis.
Modify the x-axis and y-axis Axis Title.
In the right-side panel, click Style. Go to , click Detailed, and select the Chart Styles tab.
Click Axis Title for the X-axis. In the Text section, change the title for the X-axis from uid to Number of Registered Members.
Click Axis Title for the Y-axis. In the Text section, change the title for the Y-axis from region to Province.
Click Save in the upper-right corner to save the chart.

Review the final chart.

Distribution of member page views by age
Double-click the default title above the chart and enter a new title.
Style settings.
In the right-side panel, choose .
Data settings.
In the left-side panel, click Data.
Drag age_range to Type.
Drag pv to Value. From the Value drop-down list, choose .
Click Save in the upper-right corner to save the chart.

Review the final chart.

Distribution of page views of members by gender
Double-click the default title above the chart and enter a new title.
Style settings.
In the right-side panel, choose .
Data settings.
In the left-side panel, click Data.
Drag gender to Type.
Drag pv to Value. From the Value drop-down list, choose .
Click Save in the upper-right corner to save the chart.

Review the final chart.

Numbers of page views of members counted by gender and zodiac sign
Double-click the default title and enter a new title for the chart.
Style settings.
In the right-side panel, choose .
Data settings.
In the left-side panel, click Data.
Drag gender to X-axis.
Drag pv to Y-axis. From the Y-axis drop-down list, choose .
Drag zodiac to Trace.

Modify the x-axis and y-axis Axis Title.
In the right-side panel, click Style. Go to , click Detailed, and select the Chart Styles tab.
Click Axis Title for the X-axis. In Text, you can set the X-axis title. For example, change gender to Gender.
Click Axis Title for the Y-axis. In Text, you can set the title of the Y-axis field. Change pv to Page Views.
Click Save in the upper-right corner to save the chart.

Review the final chart.

Next steps
After you finish editing the chart, click Save in the upper-right corner to save and share the result.

Charts that you save are available on the DataAnalysis page. Click
in the sidebar to view them.

