Feature Request
The Generic Object class should have a "SearchHyperCubeFor" method similar to the "SearchListObjectFor" method. This method should allow developers to rapidly search the data pages of a HyperCube.
Use case
Typically in Qlik solutions, we create HyperCubes to produce aggregated data sets that can power charts. These HyperCubes are set up to respond to selections in global state so that you get updated calculations for your charts as a user makes selections in the session.
However, sometimes a user doesn't want to make selections in the app and get updated calculations. Rather, they might be looking at a chart and want to quickly explore the results of the calculations themselves, directly within that chart.
Two examples:
-
Reviewing a table of data. Once a table has been drawn from a HyperCube, an analyst might want to quickly filter the results of that table to look for specific rows in it. This is not a data model or associative selection; its just a "brushing" of the rows in the table based on criteria in a column:
In this screenshot, a table of results has been calculated and rendered, then the user has applied some search criteria on a couple of the columns to find matching rows within the results. No need for recalculating the table or applying selections across state.
-
Any chart with large data volumes would benefit from this type of search capability. Imagine a scatterplot with hundreds of thousands of points, where you might want to search for any points where the X value is greater than 100.
Proposed Solution
Here is a rough idea of what an API could look like. I am basing this off of the "SearchListObjectFor" method. This method is the closest thing we have in Qlik Engine to what this feature request is after.
The SearchListObjectFor method takes in:
The only difference between this feature and the same feature in a HyperCube is that we need an array of qMatches, corresponding with columns in the HyperCube results where they should be applied. Something like this might work well for the example table image above:
{
method: "SearchHyperCubeFor",
params: [
"/qHyperCubeDef",
[
{
qColNo: 0,
qMatch: ">8"
},
{
qColNo: 4,
qMatch: "Program"
}
]
]
}
Existing Solutions
-
Just do the search on dimensions in the state. This is how Qlik Sense for example does table searching today. The downside of this approach is that it requires updating state that controls all charts. It will also cause the HyperCube to recalculate. It doesn't really fit the use case of searching results of a hypercube. For measure column searching, you have to use complex and expensive expressions that use aggr() to reproduce the table.
-
Using some combination of dimension limits, set analysis, and if statements in expressions. All of those require updating the HyperCubeDef and initiating a recalculation of the results. This would be a slow and undesirable experience for the use cases described above.