Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

layout.qHyperCube.qDataPages[0].qMatrix doesn't have as many elements as I do Dims/Measures

Hi,

I'm having a problem with this qMatrix structure.  It's doing something totally confusing, but I can't figure out why.

I'll layout what is happening, and what I'm expecting here first, then give a few code snippets to show you what I did (it's too many unnecessary lines to put up everything, it's happening right in call of the paint function.

Any help or general ideas of where to look is greatly appreciated!  I'm about out of ideas to follow up on.

When calling the paint function,  (just a simple paint: function ($element, layout) {

I stop in the debugger directly after the call into this function and inspect the layout structure.

in layout.qHyperCube.qDataPages[0].qMatrix, I have 663 rows of data (which looks about right), but each one of these rows has a sub-array for the columns in the rows.

For some reason, I only have 4 elements in a single row, and I'm expecting 5 or 6 (I've been debugging and trying to add more, so that's why it's 5 or 6)

My console looks like this:

layout.qHyperCube.qDataPages[0].qMatrix

Array[663]

[0...99]

0: Array[4]

0: Object

1: Object

2: Object

3: Object

And, I'm expecting a 4: Object and 5: Object, but it won't get populated

If I inspect some other sections in the layout such as the layout.qHyperCube object, I have the qDimensionInfo which has 4 values in it (which, I've added 3 or 4 or 5 or 6 trying to debug), and the qMeasureInfo which has 2 items in it.  

So, the qHyperCube has all of the info, but it's not coming through in the qMatrix

I'm suspecting it's some sort of setup hard limit on the extension which I need to define differently.  I've adjusted all of the settings I can find, or find reference to.

Here are some of the settings I have:

define( [], function () {

    'use strict';

    // *****************************************************************************

    // Dimensions & Measures

    // *****************************************************************************

    debugger;

    var dimensions = {

      uses: "dimensions",

        min : 3

    };

    var measures = {

        uses : "measures",

        min : 2

    };

.........(some more non-important stuff afterwards)

(Yup, I added the debugger to make sure I was calling the right functions here.)

define( [], function () {

    'use strict';

    debugger;

    return {

        initialProperties : {

            version : 1.0,

            qHyperCubeDef: {

                qDimensions: [],

                qMeasures: [],

                qInitialDataFetch: [

                    {

                        qWidth: 10,

                        qHeight: 0

                    }

                ]

            }

        }

    };

} );

Any ideas?

5 Replies
Anonymous
Not applicable
Author

I have a same problem with 3/4 measures. Did you solve it?

print.png

ErikWetterberg

Hi,

Most likely this is a problem with qInitialDataFetch qWidth. Since this is initial properties, it will not change in your extension instance when you change the code. So:

  • verify that it is at least 5 if you want 5 values(might as well set it to something like 10)
  • create a new instance (upgrading your existing might work too)

Hope this helps

Erik Wetterberg

Anonymous
Not applicable
Author

Hi Erik,

I changed qWidth from 4 to 10 in file initialproperties.js but the problem persists.

print.png

ErikWetterberg

Good, that's the first point I mentioned above. Try createing a new chart using the extension and see if that helps.

Erik

Anonymous
Not applicable
Author

Thanks Eric. Worked for me