2 Replies Latest reply: Jun 16, 2016 3:27 AM by Frank Duchmann RSS

    backendApi.selectValues on different HyperCube than layout.qHyperCube

    Frank Duchmann

      Hello Qlik Community,

       

      I try to send a Selection to the backendApi out of an Extension in Qlik Sense.

      This works fine if I have only one HyperCube (the standard HyperCube, which can be reached with layout.qHyperCube).

       

      If I have a second HyperCube defined and created, I have not found a way to send a Selection over this HyperCube to the Backend.

      I tried to edit the backendApi settings such as dataPath and path with no luck.

       

      Here some Code to explain my problem:

       

      // Definition of the second HyperCube

      var cubeDef = {

        qDimensions: [{

             qDef: {qFieldDefs: ["activity_id"] }

             },{

             qDef: {qFieldDefs:["case_id"]}

             }

         ],

        qInitialDataFetch: [{

            qTop: 0,

             qLeft: 0,

             qHeight: 100,

             qWidth: 2
         }]

      };

       

      // Creating the second HyperCube

      var app = qlik.currApp();

      app.createCube(cubeDef, function(q1){

           console.log("Native HyperCube", layout.qHyperCube);      // Access to native HC possible

           console.log("Second HyperCube", q1.qHyperCube);         // Access to new HC possible

       

           ....  some code for an Button    .....

       

           button.onclick=function(){

                var selection = [1];          // for tests this is hard-coded    

                _this.backendApi.selectValues(0,selection, false);           //this here works only with native HyperCube

           }                                                                                       // Note that _this is defined as this right after the paint function.

      });

       

      So with _this.backendApi.selectValues(0, selection, false)         0 is always the frist Dimension of the native HyperCube, but I would like to set reference 0 to the first Dimension of my own HyperCube.

       

      Hope someone can help me.

       

      Best regards

      Frank