# Get Data

Learn how to create workspace and get data from different data sources using DataEngine Workbench.

## Content



In order to work with data in the **C1DataEngine Workbench** tool**,** you need to initialize C1DataEngine workspace.

## Create Workspace

Users can create DataEngine workspaces using the **C1DataEngine Workbench** application. Follow the steps below to create a workspace.

1.  Click the **Workspace** tab. A **Select Folder** dialog box appears.
    
    ![Workspace creation](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workspacecreation.png)
    
2.  Select an empty folder to create a workspace.
    
    
	> type=note
	> **Note**: The C1DataEngine workspaces are identified by the presence of a file named metadata.xml. If you select a folder that contains such a file, the application will attempt to open the workspace rather than create a new one.

You have created a workspace. Hence, you will be directed to the **Import Base Table** screen, where you can import JSON, SQL or CSV data.

## Get Data From ODATA (JSON)

Once you are redirected to the **Import Base Table** screen, you can see **Base Tables** and **Queries** columns in the left panel and tabs like **PROVIDER, CONNECTION, COMMAND** and **REVIEW** in the right panel.

Let's say a user wants to import JSON data using the C1DataEngine Workbench application. In order to import JSON data, follow the steps below:

1.  Select the JSON data provider in the dropdown menu of the **PROVIDER** tab. Click the right arrow button to proceed to the next tab.
    
    ![data provider selection](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_3.png)
    
2.  Enter the following URI and JSON Path in the **CONNECTION** tab. Note that OData v4 returns results in JSON format by default.
    
    |   **URI**   |   **JSON Path**   |
    | --- | --- |
    |   [https://services.odata.org/V4/Northwind/Northwind.svc/Invoices](https://services.odata.org/V4/Northwind/Northwind.svc/Invoices)   |   $..value[\*\]   |
    
    Click the right arrow button to proceed to the next tab.
    
    ![right arrow button](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_23.png)
    
3.  Edit the expressions in the **COMMAND** tab to specify the names of the columns to import. Click the right arrow button to proceed to the **REVIEW** tab.
    
    ![Review tab](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_5.png)
    
4.  Enter a unique name for the base table in the **REVIEW** tab, for example, 'Invoices'. Click the **IMPORT** button. A spinning progress indicator appears. Once the import is complete, you can see a base table entry named 'Invoices'.
    
    ![Enter table name](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_22.png)
    
    You can observe few buttons, next to the **Base Tables** entry, such as **Expand**, **Edit**, **View, Export,** **Delete** and **Import Base Table** buttons. The **Expand** button allows you to expand the list of available columns in the base table entry, the **Edit** button lets the user edit the base table, the **View** button lets you view the base table data in a resizable grid, the **Export** lets the user export the data to CSV and JSON file formats in the workspace folder, and the **Delete** button lets you delete the base table entry. An **Import Base Table** button lets the user add a new base table.
    
    ![Snapshot depicting the workbench with all buttons](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench-labelled-buttons.png)
    
5.  Click the **Expand** button to expand the list of available columns. Click the **View** button to display the base table data in a resizable grid. Note that only the first 2000 columns are displayed.
    
    ![Expand base table](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/expand-basetable-gif.gif)
    

Users can also customize the Base Table result set. This is explained in [Customize Base Table and Query Data](/componentone/docs/services/online-dataengine/visual-etl-data-workbench/visualize-transformeddata) topic.

## Create Query

After importing the Base Tables entry 'Invoices', let's say the user wants to create a query.

You can create a query by following the steps below:

1.  Locate the Queries column on the left panel. Click the **Create Query** button ![expand button](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/plus-sign.png) . You will be directed to the **Create Query** screen.
    
    ![Locate queries](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/queries.png)
    
2.  In the **TABLES** tab, select the **Invoices** Base Table in the top left cell of the grid, under the **Table** column. Click the right arrow button. Note that if you specify more than one table, you have to fill in the **Join From** and **Join To** columns for each secondary table.
    
    ![Tables tab](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_25.png)
    
3.  In the **COLUMNS** tab, click the dropdown button in the top left grid cell. Select 'Country'. In the add new row, click the dropdown button and select 'ExtendedPrice'. In the Alias column for that row, enter 'Total'. In the Operation column for that row, select 'Sum'. Click the right arrow button to move to the next tab.
    
    ![Create query](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/createquery_column.png)
    
4.  Click the right arrow button in the **RANGES** tab to move to the next Tab.
    
    ![Go to next tab](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/workbench_27.png)
    
5.  Enter a unique name for the query in the **REVIEW** tab. Here, the name 'CountryTotals' has been used. Click the **Create** button.
    
    ![Enter unique name](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/createquery_review.png)
    
    The text box at the bottom of the page is not editable, but shows the JSON data that will be used to create the query. Note that the user can copy the JSON string and use it in application code with the [CreateQueryFromJsonString](/componentone/api/services/online-dataengine/dotnet-standard-api/C1.DataEngine.Api/C1.DataEngine.QueryFactory.CreateQueryFromJsonString.html) method of [QueryFactory](/componentone/api/services/online-dataengine/dotnet-standard-api/C1.DataEngine.Api/C1.DataEngine.QueryFactory.html) class.
    
6.  Expand the newly added **CountryTotals** node. Display the results by clicking its grid icon.
    
    ![Expanded grid for query table](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/expandedgrid-querytable.png)
    
    Users can also customize the Query result set. This is explained in [Customize Base Table and Query Data](/componentone/docs/services/online-dataengine/visual-etl-data-workbench/visualize-transformeddata) topic.
    

## Combine Data from Multiple Sources

In this example, the current base table entry does not contain product category information. The user can import another table to create a join query.

Follow the steps below to join queries.

1.  After changing the provider to JSON in the **PROVIDER** tab, enter the following URI and JSON path in the **CONNECTION** tab.
    
    |   **URI**   |   **JSON Path**   |
    | --- | --- |
    |   [https://services.odata.org/v4/Northwind/Northwind.svc/Product\_Sales\_for\_1997](https://services.odata.org/v4/Northwind/Northwind.svc/Product_Sales_for_1997)   |   $..value[\*\]   |
    
2.  Modify the select statement in the **COMMAND** tab.
    
    ![Modify statement](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/join1.png)
    
    Click the right arrow button to move to the next tab.
    
3.  Enter 'Categories' as the base table name in the **REVIEW** tab. Click the **IMPORT** button. When the import is complete, you should see a base table entry named 'Categories'. Click the triangle icon to expand the list. Click the grid icon to display the base table data.
    
    ![Create categories in Workbench application](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/create-categories-workbench.png)
    
4.  Create another query from Queries panel by clicking the **Create Query** ![Add a query](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/plus-sign.png) button. Fill the cells in the grid under the **TABLES** tab as given in the image.
    
    ![Fill cells in table](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/join6.png)
    
5.  After clicking the right arrow button in the Tables tab, fill the cells in the grid under the **COLUMNS** tab as depicted in the image below.
    
    ![fill cells in the grid](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/join7.png)
    
6.  In the **REVIEW** tab, enter the query name as 'CategoryTotals'. Click **CREATE** button. The new query node gets added to the **Queries** panel. Display results by expanding and clicking the grid button.
    
    ![Snapshot of gridview](https://cdn.mescius.io/document-site-files/images/09dc0709-b6e6-44f2-a87a-75d899f9cf2c/images/combined-gridview.png)
    
    Users can also customize the Query result set. This is explained in [Customize Base Table and Query Data](/componentone/docs/services/online-dataengine/visual-etl-data-workbench/visualize-transformeddata) topic.
    
    Note that the user can copy the JSON string and use it in application code with the **CreateQueryFromJsonString** method of **QueryFactory** class.