Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fduchmann
Partner - Contributor III
Partner - 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
Partner - Contributor III
Partner - Contributor III
Author

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
fduchmann
Partner - Contributor III
Partner - Contributor III
Author

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.