In august 2020 we introduced the App Analyzer for Qlik Cloud tenants, a powerful monitoring tool which tracks metrics such as an app’s memory usage, ensuring you stay within your quotas. It also aids in app optimization by revealing field and table sizes, and highlighting potential data modeling issues like synthetic keys and data islands.
There have been some data load editor improvements that I think are worth mentioning so in this blog post I will cover some of the new features in the data load editor that I have found useful. The first, and my favorite new feature, is the table preview. The second is the ability to do a limited load and load a specified number of rows in each table. The third feature I will cover is the ability to view the script history, as well as the option to save, download and restore previous versions. Let’s look at each of these in more detail.
When building an app, my preference is to use the load data editor to load my data. With table preview, I can view loaded data tables at the bottom of the data load editor after data has been loaded or previewed in an app.
This is my favorite new feature because nine times out of ten, I want to view the data I loaded to ensure it loaded as expected and to check that my logic is correct. Having the preview table right there in the data load editor, saves me from having to go somewhere else, like the data model viewer or a sheet, to view the loaded data. I can use the preview table to check that they have the desired results. The ability to do this quick check saves me time.
As a developer, I can select the table to preview, and the data can be viewed as a table, as seen above, or as a list or grid as seen in the images below. When previewing the data as a table, the preview table can be expanded to show more rows, columns in the table can be widened and there is pagination that allows me to move around in the table. There is also an option to view the output of the load. This will show the same info you see in the load data window when the app is reloading.
List View
Grid View
The second feature in the data load editor I find useful is the preview data option. This provides an easy way for me to load some, but not all, of the data when reloading. In the screenshot below, the default of 100 rows is entered. This will load a max of 100 rows in each table. This value can be edited if desired. By default, the use store command is toggled off. When this is off, store commands in the script are ignored preventing potentially incomplete data from being exported. This feature is helpful when I want to just profile the data and see what the data looks like. It can also be helpful when there is a lot of data to be loaded and I do not need to load it all to check that the script is working as expected. Again, this is another time saver because I can limit the load thus the time it takes for the app to reload in a single step. I find this helpful when I want to quickly test a change in the script but do not want to wait for the entire app to reload.
The last data load feature I am going to cover is history for scripts. This new capability allows me to create versions of the script, name and rename scripts, restore the script from a previous version, download the load script or delete a version of the script.
I have not used the history feature much, but I can see it being helpful when I want to name various versions of the script. Every time the script is edited, it is saved to the current version. At any time, I can save that current version giving it a meaningful name. Maybe I want to make some changes to the script but want to have a backup in case it does not work. This can be done now right in the data load editor. I also have an easy way to restore a previous version, if necessary. Once a version is named, it can be renamed, restored, or deleted. All script versions can be downloaded as a QVS file. One thing to note is that the history only saves scripts created in the data loaded editor.
Hopefully, you find these new data load editor features helpful. They are available now in your tenant. Just check out the data load editor in your app.
Thanks,
Jennell
...View More
Join Principal Technical Marketing Manager Mike Tarallo and Senior Web Developer Ouadie Limouni as the team up once again to show you what is possible and what you may have missed in the Qlik Cloud platform. Witness the art of the possible, sophisticated and simple embedding, and a recent recap of the capabilities that make Qlik a leader for 14 years in the Gartner Magic Quadrant in Analytics and Business Intelligence Platforms.
In the last couple of posts, we explored qlik-embed, Qlik’s new library for embedding Qlik Sense analytics into web applications, and went over how to do silent authentication with OAuth. Since then, the library has seen some updates, and today, we’ll delve into a new feature that allows to embed charts that are created on the fly as well as look into how to handle anonymous access using OAuth impersonation.
What’s New in qlik-embed?
Charts on the Fly
One of the features thatstandout in the newest qlik-embed release is "charts on the fly." This allows you to create charts dynamically from data within a Qlik Sense app without needing the chart to pre-exist in the app itself.
Instead, you pass a chart definition including dimensions, measures, and chart properties, and qlik-embed generates it on the fly in your web app.
Here’s a quick example using qlik-embed web components:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<style>
.container {
padding: 8px;
gap: 8px;
position: relative;
flex: 1 0 auto;
display: flex;
flex-direction: column;
align-items: stretch;
box-sizing: border-box;
}
.viz {
width: 600px;
height: 600px;
padding: 16px;
border: 1px solid #bbb;
border-radius: 3px;
box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.2);
position: relative;
}
</style>
<title>@qlik/embed-web-components example - using OAuth</title>
<script crossorigin="anonymous" type="application/javascript"
src="https://cdn.jsdelivr.net/npm/@qlik/embed-web-components@1/dist/index.min.js"
data-host="<YOUR TENANT>" data-client-id="<CLIENT ID>"
data-redirect-uri="https://localhost:3000/index_oauth_object.html" data-access-token-storage="session"></script>
</head>
<body>
<div id="main-app">
<div class="container">
<h1>@qlik/embed-web-components Example</h1>
</div>
<div id="analytics-chart" class="container">
<h2>"qlik-embed" <em>analytics-chart</em> embedding chart on the fly.</h2>
<div class="viz">
<qlik-embed id="visualization" ui="analytics/chart" app-id="<THE APP ID>"
type="barchart" dimensions='["Type", "Experience"]' measures='["Count([Demo ID])"]'
properties='{ orientation: "horizontal", barGrouping: { grouping: "stacked" } }'
context___json='{ theme: "Breeze", interactions: { select: false } }'></qlik-embed>
</div>
</div>
</body>
</html>
This feature is particularly powerful for creating highly dynamic and responsive dashboards where the visualizations can adapt to the user's needs in real time. However, keep in mind that "charts on the fly" is currently limited to the chart types available in the analytics/chart UI within qlik-embed. You can refer to the chart compatibility table for the most up-to-date information.
Notice that you can now pass context using the context___json (triple underscores (___)) to apply a specific theme etc..
For instance:
<qlik-embed context___json='{ theme: "Breeze" }' ... />
Understanding OAuth Impersonation
OAuth impersonation tokens in Qlik Cloud are a game-changer for web applications needing to access resources on behalf of users, especially when dealing with different identity providers. This method replaces the need for third-party cookies with OAuth tokens to maintain state, significantly improving security and user experience.
Things to keep in mind when using OAuth Impersonation:
Do Not Expose Machine-to-Machine Clients on the Frontend: keep your client secrets in the backend.
Use a Backend Web Application for Token Issuance: Create an endpoint in your backend application to issue tokens.
Explicitly Set Scopes on Impersonation Tokens: Ensure your tokens have the minimal required scopes to enhance security.
Here’s an example snippet for issuing impersonation tokens using the@qlik/apilibrary:
import { auth as qlikAuth, users as qlikUsers } from "@qlik/api";
const qlikConfig = {
authType: "oauth2",
host: "https://tenantName.region.qlikcloud.com",
clientId: "OAuth impersonation client Id",
clientSecret: "OAuth impersonation client secret",
};
//set the host configuration to talk to Qlik tenant
qlikAuth.setDefaultHostConfig(qlikConfig);
//access token method the frontend will call
app.post("/access-token", requiresAuth(), async (req, res) => {
const userId = req.session?.user?.id;
try {
//call to Qlik Cloud tenant to obtain an access token
const accessToken = await qlikAuth.getAccessToken({
hostConfig: {
...qlikConfig,
userId,
noCache: true,
},
});
console.log("I got an access token!");
//access token returned to front end
res.send(accessToken);
} catch (err) {
console.log(err);
res.status(401).send("No access");
}
});
Or using the fetch API:
const hostConfig = {
host: "https://tenantName.region.qlikcloud.com",
};
const payload = {
client_id: "OAuth impersonation client Id",
client_secret: "OAuth impersonation client secret",
grant_type: "urn:qlik:oauth:user-impersonation",
user_lookup: {
field: "subject",
value: "SUBJECT_VALUE",
},
scope: "user_default",
};
async function getAccessToken(hostConfig, payload) {
const getToken = await fetch(`${hostConfig.host}/oauth/token`, {
method: "POST",
mode: "cors",
credentials: "include",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
const response = await getToken.json();
//console.log(response);
return response;
}
(async () => {
await getAccessToken(hostConfig, payload);
})();
Once you have the backend that generates the access token built, you can access it on the frontend in the qlik-embed library by using the "data-get-access-token" attribute and passing it the name of the function that calls your access token backend API endpoint, like this:
<script crossorigin="anonymous" type="application/javascript"
src="https://cdn.jsdelivr.net/npm/@qlik/embed-web-components@1/dist/index.min.js"
data-host="<YOUR TENANT>" data-client-id="<YOUR CLIENT ID>"
data-get-access-token="getAccessToken" data-auth-type="Oauth2"></script>
<script>
async function getAccessToken() {
const response = await fetch("<BACKEND API URL>/access-token", {
method: "POST",
credentials: "include",
redirect: "follow",
mode: "cors"
});
if (response.status === 200) {
const tokenResp = await response.json();
const accessToken = tokenResp.access_token;
return accessToken;
}
const err = new Error("Unexpected serverside authentication error");
err.status = response.status;
err.detail;
throw err;
}
</script>
You can visit qlik.dev for more information about authentication concepts.
The qlik-embed library continues to evolve, bringing powerful new features and enhanced security capabilities to the table. Whether you're creating dynamic visualizations on the fly or implementing different auth methods, qlik-embed provides the tools needed for bring Qlik analytics into your web applications.
...View More
Our Leigh Kennedy, Distinguished Principal Enterprise Architect, is back with an updated look on applying software development life cycle (SDLC) concepts to your Qlik Cloud Analytics tenants. Take it away Leigh!
This past week, with all the focus in Orlando for Qlik Connect, I decided to spend some time giving a dashboard in one of our existing demos a makeover. Given all the new capabilities that have been introduced recently, I was excited to see what I could create. Let me walk you through how I completed this dashboard makeover.
Today I am going to blog about cyclic dimensions. A cyclic dimension is a group of dimensions that can be cycled through in a visualization. The dimensions do not have to be related or have a hierarchical relationship. The dimensions only have to make sense with the measures used in the visualizations. Cyclic dimensions can be very useful when it is valuable to view a visualization across many dimensions. It becomes even more valuable if there are multiple visualizations on a sheet, or in an app, that use the same cyclic dimension. When a cyclic dimension is switched to the next field, all visualizations that use the cyclic dimension will be changed to the same field. This is a time saver. You may wonder if alternate dimensions can do the same thing. Alternate dimensions allow a user to change the dimension in a chart, but it only changes it for the specified chart whereas a cyclic dimension can change the dimension for multiple charts.Alternate dimensions can also be used in a visualization with a cyclic dimension.
Building a cyclic dimension is very easy and there are few ways to use them. You create a cyclic dimension the same as you do a single or drill-down dimension. From the Master items, create a new dimension. At the top select Cyclic dimension type, then add the fields to include. Give the cyclic dimension a name and save. Labels can be added to give the fields a different name and description. At least two fields need to be added to a cyclic dimension.
A cyclic dimension can be added to a visualization the same way a single dimension is added. Once they are added to a visualization a cycle icon will appear next to the field name as well as an arrow. By default, the first field in the cyclic dimension will be displayed. To change the dimension in the visualization, a user can click on the cycle icon or click on the label or down arrow and select another dimension.
Another way a user can cycle through the dimensions is to use a button. In the What’s New app, buttons have been created to cycle through the cyclic dimensions.
In all three buttons, the action is set to Step cyclic dimension and the Step is set to backward for the left arrow and forward for the right arrow and the cycle button in the middle.
Left arrow buttonRight arrow & cycle buttons
In the What’s New app, you can also see how changing the cyclic dimension in one visualization, updates all the visualizations using the cyclic dimension. In the screenshot below, Category Name is the current cyclic dimension.
If I switch the dimension, using any of the ways I have described above, Country Code is the dimension. Notice that the dimension in all the visualizations have been updated to Country Code in the screenshot below.
Check out Qlik Help to learn more about cyclic dimensions and to be aware of the limitations. Also watch Michael Tarallo’s SaaS in 60 video on Cyclic Group Dimensions. Try them out in your next app.
Thanks,
Jennell
...View More
On a previous blog post, we took a look at qlik-embed, Qlik’s newest embedding framework and saw how easy it is to get started using it to integrate content from Qlik directly in your web applications.
Today, we will see how to integrate qlik-embed UIs in your web applications that are connected to an OIDC-compliant IDP silently, without prompting users for authorization.
Before we get started, consider the following pre-requisites:
1- IDP:
We need an IDP, in this blog post, I will use Auth0 which offers a Free starter plan that you can use to test out this functionality.
2- Qlik Cloud Tenant:
We will configure the Qlik Cloud tenant with both the IDP provider and an OAuth Client.
3- Web App
Our Web App will be served using Node.js, so make sure to have the latest node.js version installed
Step 1- Auth0 IDP Configuration
After creating an account on Auth0, create an Application and select “Single Page Web Application” as the application type.
Next,, navigate to Settings and take node of the following:
Domain
Client ID
Client Secret
OpenID Configuration URL (you will find this after you expand Advanced Settings under Endpoints)
We will need these values later on in the post.
In the allowed Callback URLs field, add the following URL:
https://{YOUR TENANT DOMAIN}.us.qlikcloud.com/login/callback
In Allowed Web Origins, add the following URL:
https://localhost:3000
Step 2- Qlik Cloud Tenant Configuration
In this step, we will do 2 things, first, we will create and configure an identity provider. Second, we will configure an OAuth client.
2.1- Identity Provider:
Navigate to your Management Console > Identity Provider > Create New
Choose OIDC as the type
Choose Auth0 as the Provider
Enter the OpenID Configuration URL from Step 1
Enter the Client ID and Client Secret from Step 1
Expand Advanced Options and turn ON Email Verified Override
You can now Save and then Validate the IDP configuration, this will prompt you to authenticate to Auth0 (make sure you have an active user).
2.1- Configure the OAuth Client:
Navigate to the Management Console > OAuth > Click on Create new
Select Single-page app as the Client type
Select user_default for scope
Add the following as your Redirect URL
https://localhost:3000/oauth-callback.html
Add the following in the allowed origins:
https://localhost:3000
Once your Save, Copy the Client IDWe will need it in the next step.
Step 3- Creating the Web Application
3.1- Server: We will use Express to spin up a small server and use the “express-openid-connect” as a middleware to configure Auth0 and require authentication when a user tried to access resources without being authenticated.
It will redirect the user to log in and then back to the site once successfully authenticated.
the .env file should contain your Environment variables with the following:
HOST → localhost:3000
clientId → the client ID from Auth0 from step1
clientSecret → the client secret from Auth0 from step1
idpUri → the Domain from Auth0 from step1
sessionSecret → A random string
tenantUri → Qlik Cloud tenant
redirectPage → oauth-callback.html
3.2- Frontend
index.html: In the public folder, the index.html contains the setup for qlik-embed. In the script tag, the following values need to be entered:
data-host: Qlik Cloud tenant
data-client-id: The OAuth client Id from Step 2.2
data-auto-redirect: set to True, this will remove the Authorize button that appears on qlik-embed UIs. It will silently redirect to Qlik Cloud if the user is authenticated.
oauth-callback.htmlThis file contains a script tag with a qlik-embed callback. Make sure to set up data-host to your Qlik Cloud tenant url.
The entire source code can be found in the following Github Repo:https://github.com/ouadie-limouni/silent-auth-qlik-embed
Run the project:
First, you will need to generate a self signed certificate to put in the certs folder so we can be able to open localhost as https.
You can do this using openssl by following the directions below:
1- run the following command: openssl genrsa -out cert.key 2048
2- then run and hit enter on all the prompts: openssl req -new -key cert.key -out cert.csr
3- then run: openssl x509 -req -days 3650 -in cert.csr -signkey cert.key -out cert.crt
you will generate a cert.crt and cert.key files that you should put in the certs folder.
To compile and run the project:
run: npm install
then run: node index.js
Once you open https://localhost:3000, you will be automatically redirected to the Auth0 page.
After successfully authenticating in Auth0, you will be redirected to the web app and the qlik-embed UI will render the Qlik Sense app.
I hope you found this post helpful, for a more in depth tutorial and more, visithttps://qlik.dev/embed/qlik-embed/
...View More