Like all map projections, the Mercator projection (a cylindrical map projection presented by the Flemish geographer and cartographer Gerardus Mercator in 1569) is attempting to fit a curved surface onto a plane distorting the results. If you look at a map constructed using Mercator projection (see example above) you will get a distorted idea about the size of geographical objects. For instance, take a look at Greenland and compare its extension with Australia. It seems to be bigger, isn't it?If we overlap the shapes of the continent and the island we can see that, in fact Australia is 3+ times bigger than Greenland.The classic way of showing the distortion inherent in a projection is to use Tissot's indicatrix, as in the picture below you will notice that the size of the red ellipsis representing distortion becomes bigger in areas that are far from equator, in fact by construction, the Mercator projection is perfectly accurate along the equator and nowhere else.Map projections in Qlik Sense The current release of Qlik Sense ships with two map projections, Mercator and Unit (1:1 projection). We recently covered the available Geo Functions in a post called Hidden gems in Qlik Sense geospatial functions.By using some of those functions we could create maps as in the example below where the projection function helps to shrink the Canada shape.Please note that in many free KML files some sort of projection (usually Mercator) has already been applied.AMZThanks to Jonathan Pole and Yang Yang
...View More
With the gift-giving holidays comes all manner of gifts that require work before you can start doing the thing you wanted to do in the first place. Assembly, registration, installation - at best it is a momentary detour. At worst it is an infuriating concatenation of failure that leaves you not want the thing you are trying to use.I spent part of Christmas helping relatives navigate the UX pitfalls/failures of setting up new pedometers, using web apps to upload photos to be printed, and getting photos onto a digital picture frame. With each test of patience I came away with one piece of solid UX advice: When in doubt, dumb it down.When in doubt, dumb it downGeneric error messages, vaguely labeled options whose wording doesn't exactly apply to what a user is trying to do, hiding navigation, losing focus with extraneous options, clickable links that are disguised as plain text, inconsistent experiences across different device types - all of these help to reenforce the point that your users aren't mind readers; they don't have the knowledge that you had when you created an experience. The thing that is so obvious to you might not be obvious to them.This is a message I've written about before but it bears repeating: you are designing for users of different ages, backgrounds, varying levels of technically savviness, different amounts of familiarity to the content. etc. You never know exactly who might be using your creation. User experiences should be obvious and easy to follow, lowering the barrier to entry for all potential users. If you are deciding between making something "cool" or painfully obvious, choose the obvious. Make your links look like links, make your labels specific to the content, make navigation items easy to find, etc. Steve Krug has written about this in his book Don't Make Me Think. If you are looking for a beginner crash-course to designing with usability & UX in mind his book is a good start.
...View More
Have you ever had an application that takes a long time to reload and you dread making changes to the script because that would require you to wait until the reload is complete to make sure your changes are working correctly? Well QlikView and Qlik Sense both provide options that allow you to test your script without waiting for the entire reload to complete – Limited Load and the First prefix.QlikView and Qlik Sense have Debug capabilities that allow you to do a Limited Load. With each product, you can enter the maximum number of records that each Load and Select statement can load. This reduces the execution time of the reload but still lets you to test that the script runs properly. Limited load can be very useful when the data sources are large or when you are testing with live data and want to keep the execution time low.In QlikView and Qlik Sense, you can access the Debug window from the script editor. In QlikView, you can find it in the File menu or on the toolbar.The Debug window looks like the image below. You can check the Limited Load checkbox and enter the maximum number of records you want loaded with each Load and Select statement.In Qlik Sense, you can also access the Debug panel from the Data Load Editor.Clicking on the Debug icon opens the Debug panel at the bottom of the page. You can check the Limited Load checkbox and then enter the maximum number of records you want loaded with each Load and Select statement.Another option that can be used to reduce the number of records loaded is the First prefix. This can also be used with a Load or Select statement to set the maximum number of records that are loaded. The difference between the Limited Load and the First prefix is that the Limited Load will apply to all Load and Select statements in the script whereas the First prefix is manually added to each Load or Select statement that it should apply to. For example, I could run the script below to load only 10 customers from the Customers QVD.The First prefix can be written as it is above or with parenthesis like this: First (10) LOAD. If there are many Load and Select statements in the script, a Limited Load may be easier to use but if there are only a few Load/Select statements or if there is one data source in particular that has a lot of records, then the FIRST prefix may work best.Keep in mind when using Limited Load or the First prefix that all the data may not be loaded and you may find that visualizations are not showing data or that selections are not providing the expected result. This is really noticeable if you do a Limited Load with only a few records like 5 or 10. When using Limited Load or First, the data that is loaded may not be associated so you may end up with tables in the data model with disconnected data. That is ok, once you do a full reload, everything will look as you expect.Limited Load and the First prefix both can reduce the execution time of the reload script which can be helpful when you want to just test a script or when you are testing with a live data source. There are times when you need to load all the data in order to ensure that the script logic is working – it all depends on the specific application - but it is good to know when working with large data sources that there are options that can reduce the reload time.Thanks,Jennell
...View More
Today I'll be posting on behalf of Yang Yang who recently came up with this interesting article around the geospatial functions available in Qlik Sense, I'm sure you'll enjoy it.Arturo
Qlik Sense is Gorgeous and Genius. So far, you probably have seen the intelligent visualizations that are out-of-the-box in Qlik Sense, including maps. What about advanced geospatial functions such as merging geometries or the converting spatial projections? Will those features be added in Qlik Sense product? I recently bumped into a few geospatial functions that are not yet well known. Here are the findings from my experimenting of those functions. The QVF and supporting data are also available for download at the bottom of the article.
Two categories of functions
There are two categories of these geospatial functions: aggregation and non-aggregation.
Aggregation functions will take the input of a set of geometries (points or areas) and output with one geometry. For example, you can merge multiple areas together and draw a single boundary for the aggregation on the map. On the other hand, non-aggregation function will only take the input of one geometry and then output one geometry. For instance, you provide the boundary geometry of one area to a function called GeoGetPolygonCenter, it will return the point geometry (longitude and latitude) for the center of that area.
There are two types of parameters that may required by the geospatial functions:
- Geometry, can be any of the following:
a point (latitude, longitude)
an area
- Projection, With Mercator projection you can represent maps in square format, correcting for the distortion created by stretching. This can be any of the following:
'unit' (default) - projection is 1:1
'mercator'
Aggregation functions
There are five aggregation functions available in the current release of Qlik Sense (1.0.1).
GeoAggrGeometry
This function can be used to aggregate a number of areas into a larger area, for example aggregating a number of sub-regions to a region.
GeoAggrGeometry(geometry).
A typical use case of this function is: A company has geospatial boundary data for each postcode areas in Sydney and the sales revenue from each area. A sales person has his or her sales territory that covers a number of postcode areas. The sales territory will be adjusted from time to time and there's no geospatial data for the boundary of this changing territory. How can the company present the total of sales by region on a color filled map?
With GeoAggrGeometry(), we can calculate the aggregation of multiple suburb level geometries and generated the merged territory geometry in the data model. If the sales territory changes, the new merged boundary can be reflected on map after the reload.
GeoReduceGeometry
This function can be used in scripts to aggregate a geometry into an area.
GeoReduceGeometry(geometry)
This function is similar to GeoAggrGeometry(). The only difference is, though the areas are aggregated, area level boundary lines are still kept on the map display.
GeoBoundingBox
This function can be used in scripts to aggregate a geometry into an area and calculate the smallest GeoBoundingBox that contain all coordinates.
A GeoBoundingBox is represented as a list of four values: left, right, top, bottom.
As explained above, this function will firstly aggregate a set of geometries together, then it will produce four coordinates for the smallest rectangle that contains all the coordinates of that aggregated geometry.
To visualize the result on map, you need to transfer the 4 coordinates string into ordinary polygon format, tag the transferred field with certain geopolygon format, drag and drop that field into the map object, then you can see rectangle boxes.
GeoInvProjectGeometry
This function can be used in scripts to aggregate a geometry into an area and apply the inverse of a projection.
GeoInvProjectGeometry(projection, geometry)
GeoProjectGeometry
This function can be used in scripts to aggregate a geometry into an area and apply a projection.
GeoProjectGeometry(projection, geometry)
Non-aggregation functions
There are four non-aggregation geospatial functions in the current release of Qlik Sense (1.0.1).
GeoGetPolygonCenter
This function can be used in scripts and chart expressions to calculate and return the center point of a geometry.
GeoGetPolygonCenter(geometry)
In some case, we want to plot dot instead of color fill on map. If the existing geospatial data is only available in the form of area geometry (e.g. boundary), we need function that can retrieve one pair of longitude and latitude for the center of area. Therefore, GeoGetPolygonCenter() is provided in Qlik Sense.
For example, we can still create bubble map like below to plot the central points of Sydney suburbs, though we only have boundary information in the data source.
GeoGetBoundingBox
This function can be used in scripts and chart expressions to calculate the smallest GeoBoundingBox that contain all coordinates of a geometry.
A GeoBoundingBox is represented as a list of four values, left, right, top, bottom.
As described in the previous section, with a few extra steps, you can visualize rectangle boxes on a map object.
GeoProject
This function can be used in scripts and chart expressions to apply a projection to a geometry.
GeoProject(projection, geometry)
This is a projection function for a single geometry. As explained in the previous section, this function will be useful for map areas that are close to the north or south pole.
GeoMakePoint
This function can be used in scripts and chart expressions to create and tag a Point with latitude and longitude.
GeoMakePoint(latitude, longitude)
Those non-aggregation functions can be called in load script. Error message will be thrown if they are used together with "group by" clause.
It's exciting to play with the brand new geospatial functions. When you enjoy discovering more business insights with those out-of-the-box features, please remember, this is just the beginning of Qlik Sense.
Yang Yang - Qlik Senior Solution Architect
...View More
For those of you who are interested in how tickets can be used in Qlik Sense to integrate authentication with identity providers, you should continue reading.Tickets as a means to give users access to things was used long before the invention of computers. When you go to the cinema, you first need to buy a ticket from a cashier or from the Internet – a ticket that is valid for one movie at a certain time. The ticket is later validated by the person letting you into the correct theatre for the movie for which the ticket is valid.One benefit of a ticket system is that it is independent of how you get the ticket. The ticket is valid for access to the movie, no matter what.So how can we use the same concept to gain the same flexibility when we authenticate users in Qlik Sense? We use tickets, but this time the tickets are digital.In QlikView 11.0 we introduced a concept that called Web Tickets. In Qlik Sense we have developed this idea further and this is now the normal way to make the authentication.So how does this work in Qlik Sense?You connect to Qlik Sense Proxy and try to gain access, but as you don’t have a session yet the proxy will ask you to go to an authentication module.You go to the authentication module that can validate that you are who you say you are.You get validated by the authentication module based on something you are, something you have, or something you know.If successfully validated, the authentication module will request a ticket from the proxy. As the proxy trust the authentication module it will grant a ticket. The ticket is special in that it is only valid for the person you say you are for a short period of time.You can now return to the proxy with the ticket. The proxy will validate the ticket and grant you access to Qlik Sense.So how do this look in real life if we wanted to integrate with Salesforce?You enter https://[Server name]/hub in your browserYou get redirected to an authentication module by the proxy with an identifier of where the module can request a ticket, the proxyRestUri, and a token that can be used to get the proxy to tell you where it should send you back, the targetIdYou get validated by the authentication module that uses Salesforce to authenticate the user based on something you are, something you have or something you know.The authentication module sends a request (HTTP POST) for a ticket to the proxyRestUri/ticket in JSON format like this. { "UserDirectory":"SalesForce", "UserId":"hkp", "Attributes":[ { "org":"Qlik" } ], "TargetId":"7f9c12ab-d656-4dbe-8d14-a2d55fa52f6c" }And gets a response like this{ "UserDirectory":" SalesForce", "UserId":"hkp", "Attributes":[ { "org":"Qlik" } ], "Ticket":"iokrVXS-IndQgEON", "TargetUri":"https://testsrv.test.com/hub"}You redirect the user back to the targetUri with the ticket (https://testsrv.test.com/hub/?QlikTicket=iokrVXS-IndQgEON) and the user will be granted access to Qlik SenseBut for this to be secure, there are two requirements:The call to the proxy is only allowed if the authentication module is trusted by the proxy. This is achieved by the use of certificates (which can be exported from the QMC).The request for a ticket to the proxy must contain a Cross Site Request key in the header (X-Qlik-Xrfkey) and the same key must exist in the URL (Xrfkey).If you would like to get your hands dirty, you will find examples on ticketing on Qlik Branch and more documentation on the Qlik Sense help site
...View More
Sometimes it’s the small details that make a very big difference. Intelligent responsive design is completely integrated in Qlik Sense; it seems so brilliant to me that I don’t want it to go unnoticed for you.
Responsive web design (RWD) is an approach to web design aimed at crafting sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from desktop computer monitors to mobile phones).
A site designed with RWD adapts the layout to the viewing environment by using fluid, proportion-based grids, flexible images (…)
Wikipedia
Qlik Sense has taken it one step further than the RWD described above, by adding responsive intelligence into the objects themselves.Intelligent responsive design is not just adjusting the layout to make objects and charts to fit nicely into your device’s screen, but it’s a product smart enough to know when to switch between summary and detailed information based on the available real estate. Qlik Sense is automatically adjusting and tweaking each individual object and chart to give us the right visualization anywhere, optimizing the entire user experience for the device being used.Let’s review some of my favorite examples of intelligent responsive design in Qlik Sense:This scatter chart is displaying Product group Sales Amount vs Margin. As soon as I fine-tuned some basic chart properties, Qlik Sense will do the rest, maximizing the information displayed based on the available real estate. It’s a fluid chart.As you will notice in the scatter chart above not all the labels are visible, Qlik Sense is adjusting the amount of information to increase user comprehension.The same chart displayed in a smaller device introduces some changes; first, we notice that even fewer labels are being displayed so we can easily see the patterns and correlation. Second, the x-axis’ scale is a bit wider to avoid adding noise into the chart.Within the chart shown above, the same visualization is in yet another size while the form factor is adapted to the available real estate. Elements such as dot size, dot labels and axis are scaled again. In this smaller version of the chart, the axis labels and the home icon have been removed automatically and font size has been adjusted.Line thickness is adjusted in line charts and a scrolling mini-charts appears when needed.Pie chart labels and values only appear if enough space.Qlik Sense has adapted these charts, rescaling the level of detail and functionality to maximize the user experience; this is not just resizing, but intelligent responsive design.Enjoy Qliking!AMZ---PS: I’ve had to force Qlik Sense to let me do a pie chart like that; by default Qlik Sense is preventing me to commit the crime. I do not recommend a rainbow pie chart to represent that data, a bar chart or a treemap would've been more effective… but if you still want to do it, do it in style.
...View More
One Qlik function that occasionally causes confusion is the Date function. I have often seen errors caused by an incorrect usage of it, so today I will try to explain what the function does – and what it does not.
When something is well designed it shows that time and consideration have been made to create something that is well thought-out and not just hastily thrown together last minute. It shows planning. It’s like wearing a well designed suit: it shows you put effort into presenting the best possible version of yourself.In the 1970s & ‘80s Van Halen was one of the biggest rock bands in the world. They had a huge stage show: 9 eighteen-wheeler trucks full of equipment traveled with them from city to city and at every show this equipment had to be assembled and disassembled. Van Halen also had a rider – a rider is a list of the requirements & demands a performer or band need fulfilled in order to perform. It is the concert promoter’s job to meet all of these requests. Usually you hear about a band’s rider when they make crazy requests such as how much alcohol they want, how many towels they need, exotic foods, etc. Van Halen’s rider was a massive document with mostly technical requirements on how to assemble their equipment but in the middle of the document, out of nowhere, there was a line-item that said there should be a bowl of M&Ms but “…there will be no brown M&M's in the backstage area, upon pain of forfeiture of the show, with full compensation.” The no brown M&Ms became the stuff of rock lore but there was a really practical reason why it was included. The M&Ms were the canary in the coal mine, they were a visual indicator whether or not the rider had been read in detail and followed. The band knew that if the concert promoter didn’t catch that detail then guaranteed if they did a line inspection of the equipment there would be other problems.To Van Halen the brown M&Ms were a reflection of the concert promoter’s attention to detail. They knew if this simple front-end item was broken then guaranteed there were more problems on the back-end, that the concert promoter didn’t take the time to pay attention to all of the necessary details.Like seeing brown M&Ms, a poorly designed application can be treated with suspicion as to the overall quality. We generally consider well designed items to be of better quality. Good design is an indicator that something is smart and well created - that the designer knows what they are doing. Take the time to consider the design of your applications because your users certainly will.
...View More
In QlikView, as well as in Qlik Sense, there are numerous places where you can enter texts or expressions: In text objects, as measures in charts, as labels of objects, in variables, etc. If you start the text with an equals sign, this tells QlikView that “here comes a formula”. So, QlikView evaluates the string and calculates the expression instead of just treating it as a text constant.
Sometimes you must to use an equals sign, and sometimes not. But how can you know whether you must use an equals sign or not?
Basically, QlikView can interpret the text in two ways; either as a text (i.e. as a value) or as an expression. And what QlikView does by default varies from place to place.
In a chart measure (the expression), the text is interpreted as an expression. This means that you do not need an initial equals sign. It is OK to enter one anyway – it will not change the interpretation. This is an assignment by expression. This means that the value will be recalculated every time the user clicks. If you instead want to show the text as text, and not evaluate it, you need to enclose it in single quotes. There are many places in QlikView that behave this way: Measures, background colors, show conditions, calculation conditions, etc.
This is very different from e.g. QlikView Text boxes. Here, the text is interpreted as text. This is an assignment by value. This means that if you write an expression, it will not be evaluated unless it starts with an equals sign. Many places in QlikView behave this way: Text boxes, labels, Set statements, dollar expansions, etc. All places where it makes sense to use a plain text or a simple value behave this way.
Variables need a couple of extra words. Normally, you assign a variable by value; either in the script using a Set or Let statement, or in the user interface through an Input box or in document properties (Variables sheet).
An alternative is to use an assignment by expression. Then the value of the variable will be recalculated every time the user clicks, before it is used in other formulas. Just make sure that the little equals sign is there, and it will work.
Dollar expansions use exactly the same logic. If you have a dollar expansion without an equals sign, the enclosed text will be read as-is and used as a variable name. But if you instead use an equals sign, the enclosed text will be evaluated before it is expanded.
For example, assume that the variable vEndYear has the value of ‘2014’. Then
$(vEndYear) will be expanded as ‘2014’
whereas
$(=vEndYear-1) will be expanded as ‘2013’
Finally, a small word of warning: The initial equals sign means an extra calculation every time the user clicks. And every small calculation uses some CPU time and carries a small performance penalty. Hence, you should not use too many calculated expressions. Use them only in the cases where you really need them.
The little equals sign is your friend. Use it wisely.
HIC
Further reading related to this topic:
The Magic of Variables
The Magic of Dollar Expansions
...View More
Did you know that you can hide fields in your data model from appearing in a field list? Similar to how we have the ability to show and hide system fields, we can also show and hide fields that we create in the script. When the Show System Fields checkbox is checked, system fields and all fields created in the script are listed. When the Show System Fields is not checked, the system fields and any fields hidden using HidePrefix or HideSuffix will not be displayed in the list.It is very easy to do. In the script, you set the user defined variable HidePrefix to the text that will prefix fields that you would like to hide. In the Call Detail Record Analysis demo, I created a sheet that acted as a report giving the user the ability to select the dimensions and measures they wanted to see in the table.To create the list of dimensions and measures that I wanted to make available to the user, I created two new fields: _dimension and _metrics. You can find details on how to create a customizable report in this blog. These fields are used solely on the report sheet to display the dimensions and measures so I decided to hide them so that they did not clutter up my field list. To do this, I set the HidePrefix variable in my script.SET HidePrefix = '_'; This means that any field that starts with the underscore (_) character will be hidden from the field list. I then created my new fields with the underscore prefix.Dimensions: LOAD * INLINE [_dimension Call Date Calling Number Called Number Cell Towers Visited IMSI Direction First Cell Tower Last Cell Tower Manufacturer Phone Type Reason for Drop Week ]; Metrics: LOAD * INLINE [_metricsNo, _metrics 1, Calls 2, Distinct Cell Towers 3, Dropped Call 4, Handovers 5, Setup Time 6, Talk Time ]; So now when I view the field list with the Show System Field checkbox unchecked, I cannot see the fields I created using the underscore character in the Available Fields list.This keeps the available fields list shorter and removes fields that I know the user will not need to use anywhere else in the application. Users also have the ability to use HideSuffix as well which does the same thing as HidePrefix except this looks at the ending of the field name for the text that is set in the HideSuffix variable. HidePrefix is an easy way to keep the field list in your application clean and hides fields that you may not want the user to use or that you may want to hide to eliminate confusion. Thanks,Jennell
...View More