Teneo Developers

Development setup

The Development Setup for the Power BI connector showcases how to connect Power BI Desktop to your Teneo solution and retrieve data from a chosen log data source (LDS) by executing shared queries on your behalf. The connector is intended to be used in a development setup. It is a simpler connector that can handle smaller amounts of data very quickly and that is very easy to set up following the instructions below.

PBI Dev setup - gif

Setup structure

With this setup, Power BI fetches data directly from the results of published shared queries in Teneo Inquire.

dev arch

This approach works great for the following scenarios:

  • Working with a project in development with small amounts of data
  • Building a proof of concept
  • Exploring which queries are relevant and what dashboards are needed

Getting started

Prerequisites

These instructions assume you have a Power BI premium license and a published solution. Alternatively, you can publish and use the prebuilt Longberry Baristas solution and queries included in your environment. The published bot should also have been in use in order to generate some interesting log data.

Retrieving the connector

The solution contains a .mez file that enables Power BI to connect to Teneo Inquire and execute shared queries. Shared queries can be created and saved in Studio at any time to allow a team of developers to quickly extract the information they need from a project's log data. When using the Power BI connector, this makes it easy to access the data needed for whatever Power BI visualizations the team is using. More information on how to create and save these queries can be found here.

  1. Download the connector from GitHub.
  2. Move the file to C:\Users\USERNAME\Documents\Microsoft Power BI Desktop\Custom Connectors. Alternatively, if your 'Documents' folder is located in 'OneDrive', use the path C:\Users\USERNAME\OneDrive\Documents\Microsoft Power BI Desktop\Custom Connectors.

This folder is not always created by Power BI Desktop. If it is not, it will need to be created manually.

Enable Third party extensions

By default, Microsoft Power BI will not allow access for third party extensions unless they are manually enabled. To use our connector, we will need access.

Adjust the data extension security settings as follows:

  1. In Power BI Desktop select 'File', followed by 'Options and settings'.
  2. In 'Options', navigate to 'Security'.
  3. Under 'Data Extensions', select (Not Recommended) Allow any extension to load without validation or warning.
  4. Press 'OK', and then restart your Microsoft Power BI Desktop.

Writing queries

Power BI has its own way of tagging the data being queried, and these tags should also be used when designing the initial queries; a string should be tagged as a string, a date as a date, etc. This can be done in Teneo with the 'as' notation, demonstrated here, and variable prefixes. The following table contains examples of how to use variable prefixes:

PrefixExample valueDescription
dd:DateThis prefix denotes a date, without the addition of time. If not stored as a date variable, Power BI will treat this value as text (string), and will not be able to compare different dates.
dtdt:DateTimeThis prefix denotes a date together with time. If not stored as a date and time variable, Power BI will treat this value as text (string), and will not be able to compare different dates.
ff:FloatThis is the prefix for a float number.
ll:LogicalThis prefix is used for logical values, e.g. a boolean.
nn:IntegerThis prefix is used for whole numbers without any decimals.
ss:StringThis is the prefix for a string.
tt:TimeThis is the prefix for a time, without the addition of date.

The prefixes uses the same format done inside Teneo Inquire, a full list of variable prefixes in Inquire can be seen here.

Publish queries

The solution needs to have published shared queries. There are a few things to you need to do in order to be able to retrieve it in Power BI:

  1. While inside the solution, select the 'SOLUTION' button located in the top left corner. This will take you to the solution backstage.
  2. Select 'Optimization', followed by 'Log Data'.
  3. Expand the 'Manage' button and open up the relevant 'Log Data Source'.
  4. Write a query using Teneo Query Language.
  5. While inside the same query, locate to the 'Share' button and give your query a name. Go ahead and add a description of this query as well. This will make sure other developers who have access to the solution can use the same query without having to re-create it.

Do not forget to add a descriptions to your query when you save them. This is crucial for Power BI to recognizing it.

  1. As a last step, we will need to publish the query. This can be done by selecting the query from the 'Shared Queries' section to the left, followed by the 'Publish' button. After pressing that button, another 'Publish' button will appear; click that one as well.

Access data in Power BI

Now it is time to access the data in Power BI. These steps are different depending on if your are using a Sandbox or Enterprise environment.

Sandbox enterprise

Here are the steps for a Sandbox enterprise user:

  1. Start off by opening your Power BI Desktop.
  2. Located in the 'Data' section, select the 'Get Data' button. This will open up a list of connectors in your Power BI Desktop.
  3. In the search bar, search for 'TeneoInquire' and select the connector that appears.

If the connector does not appear, try redoing the steps from the prerequisites.

  1. With the connector still selected, click on the 'Connect' button.
  2. You will now be prompted to enter the URL of the Teneo Inquire instance and the desired LDS. Enter these and click on 'OK'. The URL and LDS should be in the following formats:

The following steps are relevant for the free trial user. If you are using a Pro or Enterprise license, please refer the relevant details for own environment name and LDS.

The Teneo Inquire URL looks like this: https://[your_team_name].data.teneo.ai/teneo-inquire/rest. You should replace [your team name] with the name of your team, which you can find in the My Teneo page.

The Log Data Source (LDS) is the last part of the Engine URL of your published solution. You can find it by opening the bots page in your browser.

log data source

For example, if the Engine URL of your solution is: https://longberry-xxxxx.bots.teneo.ai/longberry_baristas_5jz1h5hxjb3j0931gx7qxwbns2, your LDS name would be longberry_baristas_5jz1h5hxjb3j0931gx7qxwbns2

  1. Lastly, you will need to enter your login information to this Teneo environment. In a Sandbox enterprise, these can be retrieved from the environment page. Enter these and click on 'OK'.

Congratulations, you have now made a connection between your Teneo solution and Power BI!

Enterprise Customer

Here are the steps for a Enterprise customer:

  1. Start off by opening your Power BI Desktop.
  2. Located in the 'Data' section, select the 'Get Data' button. This will open up a list of connectors in your Power BI Desktop.
  3. In the search bar, search for 'TeneoInquire' and select the connector that appears.

If the connector does not appear, try redoing the steps from the prerequisites.

  1. With the connector still selected, click on the 'Connect' button.
  2. You will now be prompted to enter the URL of the Teneo Inquire instance and the desired LDS. Enter these and click on 'OK'. The URL and LDS should be in the following formats:

The Teneo Inquire URL looks different depending on which SaaS version you are in and looks like the following:

  • SaaS Pro - https://[CUSTOMERNAME]-inquire.teneocloud.com/teneo-inquire/rest
  • SaaS Enterprise - https://query.[CUSTOMERNAME].teneo.solutions/teneo-inquire/rest

You should replace [CUSTOMERNAME] with the name of your SaaS client, which is shared with you when you become a client, together with your credentials. Alternatively you can find your Customer name in your Teneo Connection URL which is located in the 'About' section on the main Solution Main Window as seen below, Teneo Studio

The Log Data Source (LDS) can be found in the Teneo Studio, 'Log Data' section on the Solution Main Window. LDS view

  1. Lastly, you will need to enter your login information to this Teneo environment. These are the same as the ones used when you login to your Teneo Studio.

Congratulations, you have now made a connection between your Teneo solution and Power BI!

Build your own dashboards

The Teneo connector will transfer queries that are saved as 'Shared' to Power BI. The data retrieved from these queries are then used inside Power BI to create dashboards. In this step, we will demonstrate how you can quickly use the connector to build your first visual graph inside a dashboard.

  1. Located on the right hand side is the 'Fields' section. Expand one of them and select any data.
  2. Once selected, you will see a table of data appear.
  3. With the data still selected, click on any appropriate visualization to create your first graph.

You have now created your first visualization inside Power BI with the Teneo connector!

Please note that the video is only a demonstration and the selected queries should be applied to appropriate visualizations for a real use case.

Add more queries

Once you have connected your Teneo solution and Power BI, that data can be refreshed to automatically include new log data from new conversations with your bot. If necessary, you can also add more queries after the initial data load. To do this, simply write and publish your new queries in your LDS and then follow the steps from above on how to load data into your Power BI document, this time including the new queries which will now be accessible as long as they are published.

Users are advised to switch over to the Scale setup or Production Setup once testing inside the Development setup is done.

Tuning performance

  • Please see Microsoft blogs for best practices in Power BI.
  • Use a Power BI with premium license.
  • Redesign your Teneo Query Language queries to aggregate transactional data to minutes, hours, or even days, depending on the balance between granularity and performance.

Teneo Query Language queries can be redesigned to aggregate transactional data by combining the catd transformer with prefix operators.

Consider the following query:

tql

1listAll s.beginTime as 'Time', s.transactionCount as 'API Calls'
2

This query will list the number of API calls per session and can be rewritten to:

tql

1listAll time, sum s.transactionCount as 'API Calls' : catd(pattern="yyyy-MM-dd'T'hh':00:00Z') s.beginTime as time
2

This will aggregate the API Calls per hour.

Download

  • Request access to Teneo Developers to get access to Longberry Baristas here.
  • Download the connector from GitHub.
  • Import the solution into Teneo. For more details, see How to import solutions.