Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

fduchmann
New Contributor III

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

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

1 Solution

Accepted Solutions
fduchmann
New Contributor III

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

FYI

The Solution is realy simple if you know how Qlik Sense works:

qDef: layout.props.hcSection.hc1Counter  // this is the reference to the Input field

In the propertie Tab just type " =Sum(counter) " and everything works fine.

Maybe this is helpfull for someone else.



1 Reply
fduchmann
New Contributor III

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

FYI

The Solution is realy simple if you know how Qlik Sense works:

qDef: layout.props.hcSection.hc1Counter  // this is the reference to the Input field

In the propertie Tab just type " =Sum(counter) " and everything works fine.

Maybe this is helpfull for someone else.



Community Browser