1 Reply Latest reply: Jun 16, 2016 7:10 AM by Frank Duchmann RSS

    HyperCubeDef with Measures based of the Values from the Propertie-Panel

    Frank Duchmann

      Hello Qlik Sense Community,

       

      I am trying to create a Hypercube within a Qlik Sense Extension. Everything works fine when I define qDimensions and qMeasures with pre defined Fields.

      For Example: (Note that "acitivtiy_id" and "counter" is the name of the columns)

      var cubeDef = {

        qDimensions: [{

             qDef: {qFieldDefs: [activity_id] }

        }],

        qMeasures: [{

             qDef: {

             qDef: "=Sum(counter)",

        }

        }],

        qInitialDataFetch: [{

             qTop: 0,

             qLeft: 0,

             qHeight: 100,

             qWidth: 2
         }]

      }


      However, when I try to replace "counter" with a value from the Propertie-Panel it does not work for the qMeasures Definition.

      qFieldDefs works as expected. But qMeasures--> qDef is always set to 0 in the Hypercube. If I print out the value with

      console.log("Properties (Counter): ", layout.props.hcSection.hc1Counter); it gives me the right the value back.

      var cubeDef = {

             qDimensions: [{

             qDef: {

                  qFieldDefs: [layout.props.hcSection.hc1ActivityID], /** This Works */

             }

        }],

        qMeasures: [{

             qDef: {

                  qDef: "=Sum(layout.props.hcSection.hc1Counter)", /** This doesn't work */

             }

        }],

      qInitialDataFetch: [{

             qTop: 0,

             qLeft: 0,

             qHeight: 100,

             qWidth: 2
         }]

      }

       

      Hope someone can help me.

      Best regards Frank