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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulcalvet
Partner - Specialist
Partner - Specialist

Callback function for a measure

Hi everybody,

I search an example in order to load in a html page a KPI.

I created an hypercube with only one measure (from the master item libray)

Qlik generate a callback function :

function showDureeGrowth(reply, app){}

What should I write in order to load the KPI value on my web page ?

I found example for dropdown list but I don't know how to do for a single value 😞

Thanks !

Paul

1 Solution

Accepted Solutions
paulcalvet
Partner - Specialist
Partner - Specialist
Author

I finally found the solution :

The callback function :

//callbacks -- inserted here --

  function showDureeGrowth(reply, app){

  var output = reply.qHyperCube.qDataPages[0].qMatrix[0][0].qText;

  $("#val").text(output);

  }

and the html code :

<h2 id="val"></h2>

View solution in original post

3 Replies
paulcalvet
Partner - Specialist
Partner - Specialist
Author

I finally found the solution :

The callback function :

//callbacks -- inserted here --

  function showDureeGrowth(reply, app){

  var output = reply.qHyperCube.qDataPages[0].qMatrix[0][0].qText;

  $("#val").text(output);

  }

and the html code :

<h2 id="val"></h2>

Anonymous
Not applicable

Can some one help me that, where should we write call back functions?

paulcalvet
Partner - Specialist
Partner - Specialist
Author

Hi,

You have to write the function in the .js of your mashup

There is a comment //callbacks -- inserted here --

You have to write the function after this comment.

Exemple :

require( ["js/qlik"], function ( qlik ) {

qlik.setOnError( function ( error ) {

$( '#popupText' ).append( error.message + "<br>" );

$( '#popup' ).fadeIn( 1000 );

} );

$( "#closePopup" ).click( function () {

$( '#popup' ).hide();

} );

//callbacks -- inserted here --

function GetVal(reply, app){

var output = reply.qHyperCube.qDataPages[0].qMatrix[0][0].qText;

        $("#Val").text(output);