Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New 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)