Run scripts to generate reports of hybrid data sources and reports.

Source: Internet
Author: User

Run scripts to generate reports of hybrid data sources and reports.

You can use different data sources in the same report, such as RDB, TXT, Excel, JSON, HTTP, Hadoop, and mongodb. If you use a hybrid data source in a computing report that does not rely on third-party programs (such as JAVA), you can use a built-in script (Dataset). The following example shows how to use it.

In the business system, the order information is stored in a JSON file. When querying a report, you must read the JSON file and the database table (dimension table) for joint query. This example describes how to query the customer information of all orders in a certain shipping period.

The content of orders. json is as follows:


The following is the report design process.

Connect to the data source

Connect to the data source in the report designer.

Set Report Parameters

Create a report and set the report parameters (the start and end dates of delivery ).

Set Dataset

In the dataset settings window, select "script dataset" and write scripts to read files and database tables to complete association query.

A1: reads the order information in JSON format;

A2: filter data by date range;

A3: query the database customer table information;

A4: Associate files and data tables based on the customer ID to perform hybrid computing;

A5: Create a result set based on the Association result and return it to the report through A6.

 

Edit Report expression

Based on the results returned by the script dataset, write the following report expression to complete report creation.

The report results are as follows:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.