In this demo we're going to create our first dataset in Turnkey. Turnkey rules can be created to monitor datasets and report on data within the dataset that fails to meet the requirements of the rules.
Creating Products with category
- Open a workspace
- Open the Dataset tab
- Press the Create dataset button in top right corner
- Set the name of the dataset as Products with category
- Select the data provider exMon
- Paste the following SQL code into the dataset definition:
SELECT product.[ProductID] ,product.[Name] ,product.[ProductNumber] ,product.[Color] ,product.[StandardCost] ,product.[ListPrice] ,product.[Size] ,product.[SellStartDate] ,product.[SellEndDate] ,category.Name as Category FROM [Demo].[Product] product INNER JOIN [Demo].[ProductCategory] category ON product.ProductCategoryId=category.ProductCategoryID
- Press Preview Dataset to see the data the dataset contains
- Now switch to the Properties tab
- In Schedule select Every Week
- In Description write Product with category in exMon database
- Now switch to the Column settings tab
- Select ProductId
- Press Set as primary key and select Submit
- Select Standard Cost
- Change Format as type to Currency
- Change Decimal places to 4
- Select List Price
- Change Format as type to Currency
- Change Decimal places to 2
- Hover over the Save button in top right corner and select Save and Publish
Creating Sales Order Details
- Open a workspace
- Open the Dataset tab
- Press the Create dataset button in top right corner
- Set the name of the dataset as Sales Order Details
- Select the data provider exMon
- Paste the following SQL code into the dataset definition:
SELECT header.SalesOrderID, detail.SalesOrderDetailID, header.AccountNumber, product.ProductId, product.Name, product.ProductNumber, detail.UnitPrice, detail.OrderQty, detail.UnitPriceDiscount, detail.LineTotal, header.OrderDate, cust.LastName as CustomerLastName, cust.SalesPerson FROM [Demo].[SalesOrderDetail] detail left join [Demo].[SalesOrderHeader] header on detail.SalesOrderId=header.SalesOrderID left join [Demo].[Product] product on detail.ProductID=product.ProductID left join [Demo].[Customer] cust on header.CustomerID=cust.CustomerID
- Press Preview Dataset to see the data the dataset contains
- Now switch to the Properties tab
- In Schedule select Every Week
- In Description write Sales Order Details in the exMon database
- Now switch to the Column settings tab
- Select SalesOrderDetailId
- Press Set as Primary key and select Submit
- Select Unit Price
- Change Format as type to Currency
- Change Decimal places to 2
- Select UnitPriceDiscount
- Change Format as type to Percentage
- Select LineTotal
- Change Format as type to Currency
- Change Decimal places to 3
- Select OrderDate
- Change Format as type to Date and time
- Hover over the Save button in top right corner and select Save and Publish