I’ve seen a few people ask how to authenticate from an app built with the Capability APIs recently, and while there’s a lot of resources regarding authentication with Qlik Sense in general, I thought it could be helpful to some people to discuss a few details when using the Capability APIs.Let’s clear up one thing right away. There’s no endpoint to call to pass along a username and password and authenticate users. Qlik Sense is not an identity provider. If you don’t already have an identity provider and expect Qlik Sense to handle that for you, that’s just not how it works.There are two more things to keep in mind. Requiring authentication is going to trigger CORS, so make sure your app is whitelisted. And when you use the Capability APIs you must load some CSS files and a require.js file, but fetching those files requires that you are authenticated. If you don’t take care of authentication before trying to load those files, then loading them is going to fail.When you configure your virtual proxy to use an authentication module the virtual proxy will redirect you to the authentication module when authentication is required. You can either use the default authentication module or build a custom authentication module.The default authentication module uses Windows authentication (NTLM/Kerberos) and can authenticate Windows users. It’s relatively simple to configure. Just choose ticket as your authentication pattern and define either “Windows,” to show a popup, or “Form,” to be redirected to a new window with a form, in the windows authentication pattern field. The “Form” pattern will only work if your app is behind the virtual proxy.You can also create and use a custom authentication module. To configure your virtual proxy to use a custom authentication module choose ticket as your authentication pattern and then enter the address of your custom authentication module in the authentication module redirect URI field.Just how should you create your custom authentication module? There’s really not one answer to that question. The basic idea is that you need to get a ticket from the proxy API, and then request a resource behind the proxy with the ticket included as a query parameter. That will return a response with a set-cookie header and create a session cookie that will be used to authenticate all subsequent requests. But how you go about this really depends on your individual case. I’ll give you a couple of examples.If your app itself is behind the virtual proxy (created in dev-hub or uploaded to extensions and served from Qlik Sense), then the best flow would probably be for your authentication module to redirect to a login form which verifies the user’s identity, gets a ticket, and redirects the user back to the app with the ticket appended as a query parameter. Since the app itself is behind the virtual proxy this will consume the ticket and create a session.If your app is not behind the virtual proxy but already has the user information available (from a session cookie for your app, for instance) then your authentication module can request a ticket and return the targetUri (part of the response returned when a ticket is requested, generated by the initial request URI) with the ticket appended. This is exactly what the qlik-auth library for node.js does so check that out if you are interested in this pattern.If your app is not behind the virtual proxy and does not have user information before it requests resources from behind the virtual proxy then your authentication module should redirect to a login form to verify the user’s identity, get the ticket, and then consume the ticket (you can just make a get request to the /qps/user endpoint) before redirecting the user back to where they came from.You can also completely skip the authentication module redirect stuff and just check if the user has a session, and if not, handle it. Just remember that the resources (the CSS and require.js files) will have failed to load if you try to load them in the head of the document and you are not authenticated, so you’re going to need to make sure they load somehow. Generally, if I’m skipping out on the authentication module I’ll asynchronously load those assets once authentication is complete. You can use JWT or ticket authentication for this, but if you use ticket authentication Qlik Sense will try to use either the default authentication module or a custom authentication module depending on whether you’ve specified an authentication module redirect URI, so you may see some errors.The idea is to just make a call to the /qps/user endpoint (prefixed with the virtual proxy you want to authenticate to of course). The response will contain a value for session, either an object with user information, or the value “inactive.” If it’s inactive, you can do something like show the user a login form which submits to an endpoint that either returns a JWT or a ticket from the QPS API, and then make a request to the /qps/user endpoint again, passing the JWT in the headers or the ticket as a url parameter, in order to receive the response with the set-cookie header which will create the session cookie. Then you can load the assets and carry on with the rest of the app.That’s all I have for now. If you have any questions you can jump on the Qlik Branch Slack and subscribe to the authentication channel or ask me below.
...View More
Four years ago, I wrote the Customizable Straight Table blog illustrating how you can build a custom table in QlikView. Last year, I wrote the Custom Report Extension blog that shows how to use the Climber Custom Report in Qlik Sense. Today, with the help of Patric Nordstrom and Jason Michaelides, I am going to blog about how you can build a custom report in Qlik Sense. With continued enhancements to the Qlik Sense table such as column show conditions and the ability to change the column order of a table, building a custom report in Qlik Sense is possible right out-of-the-box.Patric built the attached Qlik Sense app that illustrates how to build a custom report in Qlik Sense. In this blog, I will review the steps needs to build your own report. Below is an example of how the report looks with some dimensions and metrics selected. On the left there are two filter panes, one for the dimensions and one for the metrics, that can be used to select the columns you would like to see in the report. Then there is the table which by default will be empty and will prompt the user to select the dimensions and metrics. In this example app, the user is encouraged to select no more than 5 dimensions and 4 metrics.Let’s start by looking the script. You would load your data as usual but what you will need to add to the data model is a data island for the dimensions and for the metrics. In the script below, you can see how Patric did it, providing very clear details of each dimension and metric. The first field in each table is the dimension/metric grouping, the second field is the dimension/metric name as it will appear in the filter panes. The third field is a number to represent the default order of the dimension/metric columns in the report and the last field is description data about the dimension/metric. The KPIs table has a fourth field that shows the formulas for the metrics.Once the app is loaded with the data islands, you can begin to build the custom report. You will need to add two filter panes and a table to your sheet. The Dimension filter pane uses the Dimension field and the Metric filter pane uses the Metric field. In the table, you will add 5 dimension columns and 4 measure columns since that is what is encouraged in this example. Now here is where Patric used Jason’s FirstSortedValue trick. For the first dimension, enter the text below in the Field.And this in the Label:So, you may be wondering what the expression is doing. Basically, the Dimension field is being sorted by the DimensionNo field and then, since the third rank parameter is being used, the expression returns the Dimension for the nth sorted value. In the report screenshot above, the dimensions Product Name and Product Number were selected. When you sort these by DimensionNo, Product Name comes before Product Number since 3 comes before 4 and when you rank these by their sorted value, Product Name is first and Product Number is second. This same idea was used in all the dimensions as you can see in the second dimension shown below.The measures are done in the same manner. Below is the Field and Label for the first measure and the additional measure columns will follow the same concept as the dimension columns.FieldLabelNow the last step is to add a conditional show to the columns. Basically, you only want the column to show if there is a dimension and/or metric selected to be displayed. For the first dimension column, you will set the “Show column if” property to:For the second dimension, it will be the same except if greater than or equal to 2 and so on. The first measure will have the “Show column if” property set to:Additional measure columns will follow the same format as described above for dimension columns.Once all the columns are added and the properties are applied, the user can select the dimensions and metrics they would like to see in the report. By default, the column order will be based on the DimensionNo field but feel free to drag columns in the table to a new position. For more information on how Jason used FirstSortedValue, check out his document or Qlik Sense Help.Thanks,Jennell
...View More
Hey Guys - a few weeks ago I introduced the Qlik Cognitive Engine in the Design Blog, What is the Cognitive Engine? and how it is responsible for providing an (AI) Augmented Intelligence driven experience. BUT...exactly what does that mean - "Augmented Intelligence driven experience"? Sounds like marketing-speak, right? Actually, it's not a play on words. These are powerful terms that represent machine learning AND human intuition. Simply stated - instead of just solely relying on pure machine automation, as you may find with typical Artificial Intelligence applications, Augmented Intelligence works with human interaction and perspective to solve complex business problems. And when combined with our proven, super-fast, patented Associative Indexing technology - you enable context-aware suggestions that help you ask those random questions or spot hidden insights while exploring data freely. So let me see - (Augmented Intelligence + Associative Indexing) .....hmmmm...I think I'll now call this AI² - - The Cognitive Engine is what powers our automated chart suggestions and our new Insight Advisor available in Qlik Sense. With the Insight Advisor you can search a governed library of familiar business terms that produce multiple insights for you to explore instead of a just a single presentation of data. The Insight Advisor allows you to do so much more than just ask data questions. It can be used as a way to jump start the creation of your analytics, or better yet, as you explore and make selections - new questions may be triggered and at that moment you can open the Insight Advisor and search while in the CONTEXT of your exploration using familiar business terms to find what you are looking for. Taking this one step further, the Cognitive Engine not only learns from the data, but your behavior as well, allowing you to teach the Cognitive Engine so it produced significantly relevant insights for you to explore. Want to learn more and see this in action? Check out this brief video and let us know what you think, we want to hear from you.Regards,Michael Tarallo (Twitter)QlikThe Insight AdvisorNOTE: Can't see the video? YouTube blocked by your organization or region? No problem, just download the attached .mp4 file to watch on your computer or mobile device.
...View More
In my previous blog I talked about how Qlik contributed to Team Rubicon and all of their amazing work by analyzing the data and designing a beautiful mashup to share with the world.Today, I want to get a little deeper and analyze the data for the latest hurricanes and their contribution. Last year we've started with Hurricane Harvey."Hurricane Harvey overwhelmed the Gulf Coast with tremendous wind and flood damage, leaving hundreds of thousands in need of immediate and long-term relief. Team Rubicon's initial response to Harvey saw the launch of floodwater rescue crews and thousands of members deployed for flood recovery operations." Team Rubicon worked on 50 projects and helped 31 families, most of them in Houston. With the help of our Qlik GeoAnalytics®, we can view the impacted areas like below.Here are some more detailshttps://webapps.qlik.com/teamrubiconusav3/index.html#/hurricane-harveySeptember 2017 Hurricane Maria hit Puerto Rico. "The destruction that followed left hundreds of thousands without permanent shelter and access to food, medical care, and potable water."Again, Team Rubicon helped over 1000 families and they have completed over 350 roofs!https://webapps.qlik.com/teamrubiconusav3/index.html#/hurricane-mariaThen, not too long ago, Hurricane Florence hit the Carolinas."Hurricane Florence floods caused significant and extensive damage throughout the Carolinas. While Florence made landfall over North Carolina as a Category 1 hurricane, its slow speed and heavy rainfall led to record rainfall and flooding throughout the affected areas. Team Rubicon launched Operation Silver Sun in response to Florence, focusing initially on damage assessments and later debris removal and muckouts."Team Rubicon had over 750 volunteers on scene and helped over 500 family members! What a remarkable work!The last one that we are still gathering data from, is hurricane Michael."Hurricane Michael was the strongest hurricane to hit the panhandle of Florida in decades, life threatening winds and storm surges, extensive structural damage, fallen trees, widespread debris, and prolonged power outages. Michael marks our fifth major hurricane response in just over one year since Hurricanes Harvey, Irma, Maria, and Florence."Even though we do not have the entire picture, so far over 120 families were assisted with the help of over 100 volunteers!Truly remarkable work!!!! I am so proud to be part of such a project and work with such an amazing team!!!The entire Open Initiative can be found herehttps://teamrubiconusa.org/open/Yianni
...View More
Our Bruno Calver is back with a great resource that provides references to some development best practices. The goal of this resource is to ensure a speedy, high performing development process resulting in a final application for the end user. Bruno has collected a ton of information and has consolidated it into something simple and well referenced, the Qlik Sense Development Cheat Sheet. (attached to this post). I'd like to thank Bruno for this valuable contribution. If you have questions or comments, please post them here - we want to hear from you!
Introduction
As governed self-service grows in popularity there is a significant increase in demand on the supporting infrastructure and resources. It is often the case that a number of self-service user communities are utilizing the same central and governed server infrastructure and so it is important to ensure everyone follows some basic good practices. This single page cheat sheet can be a useful reference for those self-service users to ensure they are developing and publishing applications that are fast, resource efficient, provide a great user experience and are not placing an unnecessary load on the shared server resource. Happy self-service everyone!
About Bruno Calver
Bruno is a Principal Solution Architect working in the UK with some of Qlik’s enterprise customers. His passion is working with business people to turn disparate and otherwise mundane data sets into insights and stories that can engage their audience, drive change and inspire new ways of thinking.
...View More
This week's Design Blog introduces you to the Qlik Cognitive Engine. You may have heard about our new Cognitive Engine when it made its first appearance in the Qlik Sense April 2018 release. It delivered an augmented intelligence driven experience that improved how analytics were created by learning from the data and automatically suggesting the best visualizations for chosen dimensions and measures. Building on this premise, Qlik Sense June 2018 introduced the Insight Advisor which suggests multiple analytics from the entire dataset along with new user interactions, such as the ability to choose dimensions and measures and even search allowing the Cognitive Engine to generate insights on the fly from your data by understanding the user's analysis intent and context. Going forward our cognitive engine will include enhanced machine learning algorithms not only to learn from the data but also from the user in order to present statistically significant insights bringing them front and center, helping our users to move from data to insights. With the cognitive engine, and upcoming machine learning capabilities, we are reducing the barriers to entry for analytics, so people can focus on actions and outcomes.What is the Qlik Cognitive Engine?The Qlik Insight Advisor - powered by the Qlik Cognitive EngineNOTE: Can't see the video? YouTube blocked by your organization or region? No problem, just download the attached .mp4 file to watch on your computer or mobile device.
...View More
It’s been a while since I’ve posted about how a developer can get started with Qlik, so I figured it would be a good idea to review current tools and resources for developers new to Qlik.A good place to start would be the Getting Started on the Qlik developer help page. There’s some links here to get you started building mashups, extensions, and widgets. There’s also information about creating connectors, building Windows applications, and automating administrative jobs. You can use the navigation on the left to explore. One thing that can be easily missed but may be really useful for someone new to Qlik Sense is the Concepts section, which will explain things like generic objects, hypercubes, list objects, and other concepts that are really essential to Qlik. Also, don’t miss out on the Videos you can find here.Once you’ve checked out that stuff, you should check out Qlik Branch Knowledge over on the new Qlik Branch site. While you’re at it, join Qlik Branch on Slack so you can connect with other developers using Qlik, and check out the rest of https://developer.qlik.com.When you feel like you’re ready to build something, Getting started building mashups with Dev Hub is a good place to jump in. I wouldn’t recommend trying to build production-level mashups in dev hub unless it’s simple, but it’s a good place to just get a feel for the Capability APIs. You can see how the Capability APIs are loaded and accessed, what a connection to a Qlik Sense app actually looks like and can embed a few objects or create a few cubes or lists and see what that code looks like. From there, you can check out the Capability API Reference and try building a mashup without using the dev hub. Here’s a great quick reference for Connecting to the Capability APIs.One thing you need to understand is that the Capability APIs simply provide the ability to embed visualizations and communicate with the Qlik Engine. But if you just want to communicate with the Qlik Engine and you don’t need to embed visualizations then using the Capability APIs is probably not the best choice. You should check out enigma.js, which is an open source library for communicating with the Qlik Engine. You may also want to check out other Qlik Open Source projects, such as picasso.js, a library for building visualizations that is optimized for use with Qlik.Whether you’re using the Capability APIs or enigma.js (or even some other way) to communicate with the Qlik Engine, you’ll definitely want to keep the Qlik Engine Reference handy.And what about if you’re interested in stuff like authentication and task automation? Then you’ll have to dive into the Qlik Sense Proxy Service (QPS) API or the Qlik Sense Repository Service (QRS) API. These are both REST APIs, so chances are they will feel a bit more familiar for you than the Qlik Engine API.If you're a developer that's new to Qlik and have any questions, I'd be happy to address them in the comments below!
...View More
Hey guys - thanks for taking some time to learn more about Qlik GeoAnalytics. Continuing my series that will make you more familiar with Qlik GeoAnalytics, I'm excited to show you how to use the Spatial Index operation, available within the Qlik GeoAnalytics connector. Spatial Index creates index tables that contain boundary data related to the visible selection area on a map objects. When used with the Auto Select Visible option of the Qlik GeoAnalytics Map Object, location points are automatically selected within the visible area of the map and change with panning and zooming. This option allows all of your analytics to relay related information to your selection based on the area of the map you are viewing. To learn more about this and to learn how to set it up watch this video!Regards,Michael Tarallo (@mtarallo) | TwitterQlikPrevious Qlik GeoAnalytics blog posts and videos in this series.Qlik Geocoding - Street Addresses and Qlik GeoAnalyticsGet Familiar with Qlik GeoAnalytics - Custom Info BubbleGet Familiar with Qlik GeoAnalytics - The "Closest" OperatorGet Familiar with Qlik GeoAnalytics - The Binning OperationData:https://data.cityofchicago.org/Public-Safety/Crimes-2018/3i3m-jwuy/dataNOTE: Can't see the video? YouTube blocked by your organization or region? No problem, just download the attached .mp4 file to watch on your computer or mobile device.Sample .qvf file attached.
...View More
Have you ever tried to compare two dates that looked the same to find out that in fact they were different? I was recently approached by a colleague who had this problem. In their script, they were adding a flag when the date in a field was also the last day of the month. Both dates were formatted to show the month, day and year (M/D/YYYY) but the flag was never true even when the dates appeared to be the same. When working with dates, you may find that although two dates are formatted the same, the underlying values may be different. To troubleshoot this, we used the Num function to get the numeric value of the two dates we were comparing in the script to see if the two dates were the same numerically. Take a look at the table below for an example of how we resolved the issue.Steps Date 1 Date 2 NotesStart with these dates2018-10-05 05:16:5010/5/2018Format Date 1 to display the date like Date 2 is formattedDate('2018-10-05 05:16:50', 'M/D/YYYY')>>10/5/201810/5/2018Is Date 1 = Date 2?10/5/201810/5/2018No, not equalUse Num() to see numeric value of datesNum(‘2018-10-05 05:16:50’)>>43378.220023148Num(10/5/2018)>>43378The numerical values of Date 1 and Date 2 are not the sameUse Floor to round Date 1 down to just the dateNum(Floor(‘2018-10-05 05:16:50’))>>43378Num(10/5/2018)>>43378Using Floor, is Date 1 = Date 2?Num(Floor(‘2018-10-05 05:16:50’))>>43378Num(10/5/2018)>>43378Yes, they are equalSo let’s explain what is going on here. We started with 2 dates – one that had a timestamp and one that did not. After formatting the dates the same, it was determined that the dates were not equal. This is because the underlying numeric value of Date 1 still included the time even though the time was not visible after it was formatted as M/D/YYYY. The numeric value of 2018-10-05 05:16:50 is 43378.220023148 while the numeric value of 10/5/2018 is 43378. When looking at the numeric values, the value before the decimal point represents the date and the value after the decimal point represents the time. To handle this, the Floor function was used. According to Qlik Sense Help,Floor() rounds down a number to the nearest multiple of the step shifted by the offset number.Compare with the ceil function, which rounds input numbers up.Syntax: Floor(x[, step[, offset]])Once the floor function was used, Date 1 was rounded down to just the date, giving it a numeric value of 43378 - the same as Date 2.It is helpful to remember that dates have numeric values. We often see dates formatted to meet our needs which is great but when we need to compare dates, we need to look beyond the displayed date and look at the numeric date. The Date function controls how the date is displayed but it does not change the underlying value of the date. In this example, the Floor function rounded the timestamp down to just the date. The Ceil function works similarly except it rounds up. You can also check out Henric Cronstrom’s blog titled Why don’t my dates work? for other date related issues you may stumble upon. I hope you find this blog helpful and that it helps you quickly troubleshoot date comparison issues should they arise.Thanks,Jennell
...View More