Qlik Community

Ask a Question

Qlik Sense Integration, Extensions, & APIs

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

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

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
Partner
Partner

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.



View solution in original post

1 Reply
Partner
Partner

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.



View solution in original post