Set analysis is one of the more powerful tools you can use in Qlik Sense and QlikView. Its syntax is sometimes perceived as complicated, but once you learn it, you can achieve fantastic things. There is now an additional way of writing the Set expression, that may simplify your code.
I love this new capability - Chart Level Scripting! This takes generating insights to a whole new level. No longer am I required to write complex reporting frameworks or move complex logic to the backend data model. Read on!
Can't see the video? Watch on the Qlik video sitehere.Missed Tip #1? - View it here.Tip #2 covers the data you should be using with Qlik AutoML. When creating new ML experiments with Qlik AutoML – you are prompted to select data from the Qlik Catalog. Though you will see data that has been registered in the catalog, it is important to note that not just any data can be used with Qlik AutoML. Historical data ( data you normally use for analytics and reporting with dimensions, measures, time periods, etc. ) is generally not suitable for machine learning. Why? Data you’re accustomed to using in analytics apps is captured all at the same point in time (current, end of day, end of month, etc.). With machine learning and predictive analytics, the dataset needs to contain an outcome we care about and a set of attributes we call features (typically your dimension fields / values) that existed prior to that outcome. That way, a machine learning model can learn the patterns that led to that outcome and therefore identify them in advance when we apply the model to live or current data. That being said – you must select data from the catalog that has been prepared with the main ingredients needed to train machine learning models.Stay tuned for Tip #3 where I will briefly coverarchitecting the data set and the needed ingredients.Qlik AutoML Helpful Resources:Sample Data Page with basic creation of a Qlk Sense predictive application - walkthroughQlik AutoML Playlist (on YouTube)Qlik Help Documents - (will go live 8/16 this week)Qlik Continuous Classroom Learning ModulesQlik AutoML in the Qlik Community
...View More
Insight Advisor helps a user explore their data, generate visualizations, and analyze their data through Qlik Sense features such as Insight Advisor Search, Insight Advisor Analysis Types, and Insight Advisor Chat. In this blog, I am going to review how example questions can be added to Insight Advisor to help users when they start their analysis. Example questions are added at the app level and a developer can add example questions to any of their apps. When using Insight Advisor Search, users will see the example questions when they click in the “Ask Insight Advisor” search box (see image below). From there, users can select one of the example questions or enter a question of their own.When using Insight Advisor Chat, users will see example questions from all apps that have example questions provided they have access to those apps. Below is an example from Insight Advisor Chat. Notice that the “Show example questions” is toggled on. This needs to be on for the example questions to be presented.When Insight Advisor Chat is opened, the example questions are presented. If a user would like to see the example questions again later in a chat thread, all they need to do is click on the Questions button to view them. As with Insight Advisor Search, a user can select one of the example questions or enter a question of their own. If you find that the example questions are not showing up in Insight Advisor Chat, be sure to check the app options and make sure “Insight Advisor in hub” is toggled on. This setting can be accessed from within an app by clicking on the app name in the navigation bar and then selecting the app options icon.Now, let’s take a look at how to add example questions to an app. From within an app, click on Prepare and then select Vocabulary.Click on the Example questions tab and click on the + Add question button. In the Add Example Question pop-up window, select the language for the question and then enter the question. Once you hit enter, a preview of a generated visualization will be displayed. If you would like to add an example question in multiple languages, click the + Add language button, select the language, and enter the example question in the respective language. Once you are done adding the question, in their respective languages, click the Add button to add the example question.Repeat this process until all example questions have been added to the app. Here is what it will look like once all the example questions have been added.Example questions for Insight Advisor allow developers to provide hints and help when using Insight Advisor. They can be used to get the user started with using Insight Advisor and guide them on how to ask their questions about an app. Check out Michael Tarallo's SaaS in 60video and if you need more information, check outQlik Help. If you are interested in Insight Advisor Analysis Types, check out my blog.Thanks,Jennell
...View More
Can't see the video? Watch on the Qlik video site here.Tip #1 – covers knowing the outcomes you wish to predict, as well as the questions you want to ask based off your current findings from your historical analytical data. Let’s say when analyzing your sales and order data you have noticed a number of orders that have been cancelled. Further investigation shows those cancelled orders have gone unfulfilled for a specific period of time since being placed. This may be due to the sheer volume of orders and the number employees you have available to process them. You may want to get a better handle on understanding the pattern of cancellation and create some predictions to answer questions like:Will a customer cancel their order before it is fulfilled? - Or -How many days pass before a customer cancels their unfulfilled order?Answering these questions will enable you to be proactive with certain customer orders and possibly direct your employees to give those order priority and fulfill them sooner to avoid cancellation. Now that we have our predictive question, we need to architect a data set that will support it so Qlik AutoML can use it effectively. Stay tuned for Tip #2 where I will cover the data you should be using to train machine learning models with Qlik AutoML.See Tip #2 Available NowQlik AutoML Helpful Resources:Sample Data Page with basic creation of a Qlk Sense predictive application - walkthroughQlik AutoML Playlist (on YouTube)Qlik Help Documents - (will go live 8/16 this week)Qlik Continuous Classroom Learning ModulesQlik AutoML in the Qlik Community
...View More
When using Enigma.js to communicate with the Qlik Associative Engine to build visualizations for instance or simply to get access to data from Qlik Sense, you will certainly come across the concept of Generic Objects, which are structures for storing and interacting with data in an application. They are considered generic because of they are flexible structures that can represent many different app components such as sheets, bookmarks, hypercubes, lists etc..In this blog post, we will go over Hypercubes and List Objects providing a brief explanation of the concepts and how to use them with enigma.jsHypercubesIn Qlik Sense, a Hypercube is an interface for defining a set of data to extract. It is the definition provided to the Qlik Data Engine, which holds all information on which data is queried and how it’s calculated. If selections are applied to a Hypercube, only the selected values will be returned.For example, this can represent data needed to display some type of visualization such as a bar chart that shows “Sum of Sales” by “Salesperson”. At its simplest form, you can think of it as a table comprised of rows and columns. In that sense, our Hypercube that would power our barchart, would consist of a table with “Salesperson” as a column, and the evaluated “Sum(Sales)” expression as the other column. The engine will fill the cells of this table and extract all the information.In order to use a Hypercube, we need to define it through the “qHyperCubeDef” object which is passed on to the Qlik Engine API to create a query for processing the data.A very simple definition of a Hypercube looks like this:qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qInitialDataFetch: [{
qWidth: 2,
qHeight: 50
}]
} But since it is a very flexible tool of extracting data, that means that there is a huge amount of settings available for it. You can view the full definition of the structure here.Let’s go over the most important ones:qDimensions: defines the array of dimensions that will be used in the HyperCube. You can have multiple dimensions depending on the results you want.There is a number of settings within the dimension that you can set. More about these here.For instance, qNullSuppression: which removes null values in the dimensionqShowAll, which if set to true, displays all dimension values, regardless of whether they are selected or not.etc...qMeasures: similar to how qDimensions are defined, but used to define measures, i.e: calculations performed for each distinct value of dimensions.qInitialDataFetch: defines how many data cells are initially retrieved from the calculated HyperCube.qSuppressZero: if set to true, removes rows that have zero values across the entrie HyperCube rowqMode: defines the structure of the HyperCube that will be returned. By default, the data is returned as a straight table representation. But more advanced modes are available, such as:Pivot table representation (qMode -> P)Stacked table representation (qMode -> K)Tree representation (qMode -> T)Below is an example of a Hypercube where we define 1 dimension (ID) and 1 measure (=Sum(Value)), Notice that we define qWidth and qHeight properties within qInitialDataFetch as 2 and 5 respectively, since we have 2 columns and would like to get 5 rows of data for a total of 10 cells.P.S: The maximum number of cells (qWidth*qHeight) allowed in an initial data fetch is 10,000.const properties = {
qInfo: {
qType: 'my-straight-hypercube',
},
qHyperCubeDef: {
qDimensions: [
{
qDef: { qFieldDefs: ['ID'] },
},
],
qMeasures: [
{
qDef: { qDef: '=Sum(Value)' },
},
],
qInitialDataFetch: [
{
qHeight: 5,
qWidth: 2,
},
],
},
};So how does the implementation look like in enigma.js?For the purposes of this example, we are creating a Session App (i.e: have an inline script and create an app on the fly).const qlikScript = `
TempTable:
Load
RecNo() as ID,
Rand() as Value
AutoGenerate 100
`;
const properties = {
qInfo: {
qType: 'my-straight-hypercube',
},
qHyperCubeDef: {
qDimensions: [
{
qDef: { qFieldDefs: ['ID'] },
},
],
qMeasures: [
{
qDef: { qDef: '=Sum(Value)' },
},
],
qInitialDataFetch: [
{
qHeight: 5,
qWidth: 2,
},
],
},
};
const session = createSession();
// Open the session and create a session document:
session.open()
.then((global) => global.getActiveDoc())
.then((doc) => doc.setScript(qlikScript)
.then(() => doc.doReload())
// Create a generic object with a hypercube definition containing one dimension and one measure
.then(() => doc.createObject(properties))
// Get hypercube layout
.then((object) => object.getLayout()
.then((layout) => console.log('Hypercube data pages:', JSON.stringify(layout.qHyperCube.qDataPages, null, ' ')))
// Select cells at position 0, 2 and 4 in the dimension.
.then(() => object.selectHyperCubeCells('/qHyperCubeDef', [0, 2, 4], [0], false))
// Get layout and view the selected values
.then(() => console.log('\n### After selection (notice the `qState` values):\n'))
.then(() => object.getLayout().then((layout) => console.log('Hypercube data pages after selection:', JSON.stringify(layout.qHyperCube.qDataPages, null, ' '))))))
// Close the session
.then(() => session.close())
.catch((error) => {
console.log('Session: Failed to open socket:', error);
process.exit(1);
});Notice that after opening the enigma session, and calling the necessary methods for our session app, we call “createObject” to create a Generic Object with our Hypercube definition containing 1 dimension and 1 measure, then get the Hypercube Layout which returns a bunch of results including our data.We’re mostly interested in “qDataPages” which holds our calculated data. Below is how the typical response looks like:Going back to our code, the full qDataPages results are as follows from our first console.log:Hypercube data pages: [
{
"qMatrix": [
[
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "O"
},
{
"qText": "0.73213545326144",
"qNum": 0.732135453261435,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "2",
"qNum": 2,
"qElemNumber": 1,
"qState": "O"
},
{
"qText": "0.66564685385674",
"qNum": 0.6656468538567424,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "O"
},
{
"qText": "0.66189019801095",
"qNum": 0.6618901980109513,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "4",
"qNum": 4,
"qElemNumber": 3,
"qState": "O"
},
{
"qText": "0.98009621817619",
"qNum": 0.9800962181761861,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "O"
},
{
"qText": "0.48425585823134",
"qNum": 0.4842558582313359,
"qElemNumber": 0,
"qState": "L"
}
]
],
"qTails": [
{
"qUp": 0,
"qDown": 0
}
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 2,
"qHeight": 5
}
}
]Notice that we have additionally called the “selectHyperCubeCells” method in order to make a selection on the cells at positions 0, 2, and 4 in the Dimension. Here is how the results of qDataPages looks like after the selection:### After selection (notice the `qState` values):
Hypercube data pages after selection: [
{
"qMatrix": [
[
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "S"
},
{
"qText": "0.73213545326144",
"qNum": 0.732135453261435,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "S"
},
{
"qText": "0.66189019801095",
"qNum": 0.6618901980109513,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "S"
},
{
"qText": "0.48425585823134",
"qNum": 0.4842558582313359,
"qElemNumber": 0,
"qState": "L"
}
]
],
"qTails": [
{
"qUp": 0,
"qDown": 0
}
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 2,
"qHeight": 3
}
}
]List ObjectsAlongsideqHyperCube, the family of Generic Objects provides us with another structure called qListObject.Unlike a Hypercube, a List Object better serves the purposes of displaying one single dimensionwithoutany required calculation, meaning no metrics are required to be defined.As such, it is fairly straightforward to work the list objects, and their definition is very similar to theqHyperCubeobject, with some added extra properties minus measures.I usually use List Objects when I want to build a list of values to be used for selections.The following code is an example of creating aqListObjectDefand writing the resulting list object into the console:List object data: [
[
{
"qText": "0.063513102941215",
"qNum": 0.06351310294121504,
"qElemNumber": 0,
"qState": "O"
}
],
[
{
"qText": "0.15987460175529",
"qNum": 0.15987460175529122,
"qElemNumber": 1,
"qState": "O"
}
],
[
{
"qText": "0.50091209867969",
"qNum": 0.5009120986796916,
"qElemNumber": 2,
"qState": "O"
}
]
]After selection of the first value, the qDataPages response looks like the following:(Notice that with a qListObject, all values are rendered, regardless of whether they have been excluded or not.If selections are applied to a list object, the selected values are displayed along with the excluded and the optional values. We do however hava access to the qState property which lets us know if the value is selected (S), alternate (A), etc..)List object data: [
[
{
"qText": "0.063513102941215",
"qNum": 0.06351310294121504,
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "0.15987460175529",
"qNum": 0.15987460175529122,
"qElemNumber": 1,
"qState": "A"
}
],
[
{
"qText": "0.50091209867969",
"qNum": 0.5009120986796916,
"qElemNumber": 2,
"qState": "A"
}
]
]Attached is a zip file containing example code that shows how a default Hypercube, Pivot Hypercube, Stacked Hypercube, and a List Object are used in enigma.js.To run the code:first run “npm install”change the .env file with your tenant and API key (learn how to get an API key here).then, run “node filename.js” for each file and check the console logs.To see how Hypercube can be used as part of creating visualizations with Nebula.js, checkout my previous blog post: https://community.qlik.com/t5/Qlik-Design-Blog/Create-a-Slope-chart-with-tooltips-and-brushing-using-Nebula-js/ba-p/1827168
...View More
Soon we will introduce a new machine learning and predictive analytics capability to Qlik Cloud, Qlik AutoML. If you are interested in learning more, take a look at this quick video before getting started.