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: 
michael_andrews
Partner - Creator
Partner - Creator

Tutorial on Hello Data not working

I'm following this example

http://qliksite.io/tutorials/qliksense-visualization-extensions/part-01/08-Hello-Data/#

I was writing it myself, but I literally copy and pasted your example to make sure I didn't have any typos. Whenever I try to access the hyper cube data, I get an error because I get not arrow objects in my qDataPages array, so therefor no qMatrix.

The error I get is this

error.png

Here is what the data looks like.

measure.png

So I'll post the code, but it's verbatim that project.

define( [],

  function ( ) {

  'use strict';

  return {

  definition: {

  type: "items",

  component: "accordion",

  items: {

  dimensions: {

  uses: "dimensions"

  },

  measures: {

  uses: "measures"

  },

  sorting: {

  uses: "sorting"

  },

  appearance: {

  uses: "settings"

  }

  }

  },

  initialProperties: {

  },

  paint: function ( $element, layout ) {

  var hc = layout.qHyperCube;

  console.log( 'Data returned: ', hc);

  // Default rendering with HTML injection

  $element.empty();

  var table = '<table border="1">';

  table += '<thead>';

  table += '<tr>';

  for (var i = 0; i < hc.qDimensionInfo.length; i++) {

  table += '<th>' + hc.qDimensionInfo.qFallbackTitle + '</th>';

  }

  for (var i = 0; i < hc.qMeasureInfo.length; i++) {

  table += '<th>' + hc.qMeasureInfo.qFallbackTitle + '</th>';

  }

  table += '</tr>';

  table += '</thead>';

  table += '<tbody>';

  for (var r = 0; r < hc.qDataPages[0].qMatrix.length; r++) {

  table += '<tr>';

  for (var c = 0; c < hc.qDataPages[0].qMatrix.length; c++) {

  table += '<td>';

  table += hc.qDataPages[0].qMatrix.qText;

  table += '</td>';

  }

  table += '</tr>';

  }

  table += '</tbody>';

  table += '</table>';

  $element.append( table );

  }

  };

  } );

10 Replies
durgesh22
Creator
Creator

Deleting and adding an extension to the sheet solved my problem.

Thanks