Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
savandriy
Contributor III
Contributor III

Qlik Extension: Get all data for field

Hello again guys!

My quest on building an extension for advanced filters continues. Now I want to get all data by field.

For now, my code looks like this:

const getDataByField = function (app, fieldName) {
    return new Promise((resolve, reject) => {
        // We'll create a table, which we'll then take hypercube data from
        var table = app.createTable([fieldName], [], {});
        table.OnData.bind(function () {
            // Create an array of pages to retrieve
            var pageArray = [];
            for (let i = 0; i < 1; i++) {
                pageArray.push({qTop: 10000 * i, qLeft: 0, qWidth: 1, qHeight: 10000 * (i + 1) - 1});
            }

            // Set up the main retrieve
            table.model.getHyperCubeData('/qHyperCubeDef', pageArray).then(function (data) {
                let rows = data[0].qMatrix;

                var outputList = [];
                rows.forEach(function (row) {
                    outputList.push(row[0].qText);
                });

                // Kill the imaginary table
                table.OnData.unbind();
                app.destroySessionObject(table.model.id);

                resolve(outputList);
            })
        })
    })
};

But I'm limited to 10k rows. It looks like qlik.app.field.getMoreData() might be what I'm looking for, but the docs have zero info 😢

Any tips?

Labels (3)
2 Replies
savandriy
Contributor III
Contributor III
Author

Does anyone have any idea how to achieve this? The question is still relevant 🙏

ErikWetterberg

The limitation of 10000 cells is for each getHyperCubeData call, so building up a page array will not help you. You need to make multiple calls  instead. But should you really do this? What happens  if there are millions of rows?