Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
salcin
Partner - Contributor II
Partner - Contributor II

How to stop ongoing loading of table in Qlik Mashup when new filter selections are made?

I'm working on a mashup report where we read 10,000s of invoice lines. Because the data is to large for a single hypercube, the data is read 1000 lines at a time per "page" similar to the approach at the bottom of this page https://support.qlik.com/articles/000028500


So far so good. A reading of a few thousand lines takes a few seconds. And the invoice lines are displayed in an html table in the mashup. Each page of 1000 invoice rows are shown directly to the user and the results grows incrementally in the UI when new pages are loaded. 


The problem: We use filters in the mashup UI to select year, month and other filter criteria. If you make a new filter selection while a previous reading of data takes place, both the previous data and the new filter selection will be displayed. It will be a mixture of two different filter choices. For example: you first select invoices in January and then quickly change the filter to only February, (before all January pages has been loaded completely), then both January and February are shown mixed in the results. It is expected that only February should be shown.

However, if you change the filter after the previous data is loaded completely, there is no problem and the correct filtered data is shown.

The cause: It seems like when loading of data is triggered (according to this approach see link above) it will continue loading until it is finished even if the user interacts which the filters in the mashup. When several loading events take place at the same time the data will be mixed in the results.

Expected solution: I want to find a way to stop previously started loading of data to the mashup when a new filter selection is made. Also, to clear the previous results shown in the UI when the new filter selection is made. Only data related to the last filter selection should be loaded and all loading of data that stated before it should be interrupted. Is there any way to cancel loading of data when using in this approach that I have described https://support.qlik.com/articles/000028500


Has anyone encountered a similar filtering problem in Qlik Mashup before?

 

Kind regards

 

1 Solution

Accepted Solutions
salcin
Partner - Contributor II
Partner - Contributor II
Author

Thank you for your response! We managed to find a workaround. 

The problem seemed to occur primarily when the user deselected all filter choices and then quickly made a new selection. When the user deselected filters, the mashup default to load all data. For example, deselecting January as the only selected month in the month filter results in all months to be loaded (as one would expect). 

Solution: Set condition GetSelectedCount(Month) >= 1 in the Qlik app table that we load data from to the Mashup. By doing that, the user must always manually choose the months and somehow the bug seemed to disappear. 

   

View solution in original post

2 Replies
Øystein_Kolsrud
Employee
Employee

The solution will depend on what your mashup is doing when that selection is performed. Based on your description it sounds like it is the rendering in the client, not the API call to the engine, that is running at the time. If it was waiting for the engine call to complete, then you would receive a request abort on your GetHyperCubeData request which doesn't seem to be the case. There could be a retry going on though, so I can't rule it out completely.

But assuming that the client is working on processing the data result, then you probably need to implement a listener on change notifications for the object you are collecting data from. I guess you will need to abort your client activity when such a notification arrives. The response coming back from the select request will look something like this:

{
  "jsonrpc": "2.0",
  "id": 9,
  "result": {"qReturn": true},
  "change": [1,2,3]
}

Those numbers listed in the "change" property are the handles for the objects that have changed due to the selection. Most APIs have some form of built-in mechanism for handling such events so you might want to look into what that is handled in the library you are using.

salcin
Partner - Contributor II
Partner - Contributor II
Author

Thank you for your response! We managed to find a workaround. 

The problem seemed to occur primarily when the user deselected all filter choices and then quickly made a new selection. When the user deselected filters, the mashup default to load all data. For example, deselecting January as the only selected month in the month filter results in all months to be loaded (as one would expect). 

Solution: Set condition GetSelectedCount(Month) >= 1 in the Qlik app table that we load data from to the Mashup. By doing that, the user must always manually choose the months and somehow the bug seemed to disappear.