Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mel78
Contributor II
Contributor II

QLIK Sense .NET API : trying to get measure/ dimension for all objects

I read the QLIK Sense for .NET API. I am able to get data (measure / dimension) for most of the objects except  TreeMap, Map, Distribution plot and Boxplot.

I used genericObject.GetHyperCubePivotDatafor Pivot,  List object for Filterpane and for others, I used genericObject.GetHyperCubeData.

What should I do for TreeMap, Map, Distribution plot and Boxplot? I am unable to get the measures and dimensions for these objects?

1 Reply
Øystein_Kolsrud
Employee
Employee

To extract data from an object you need to know two things:

  1. Where in the properties structure are the hypercubes located.
  2. What modes do the hypercubes have.

For 1) you can do the following:

var allCubePaths = o.GetAllHyperCubePagers().Select(p => p.Path);

For 2) you'll need to inspect the "Mode"property of the cube and then use the "GetHypercubeData" version corresponding to that mode. Something like this:

var cubeMode = o.Properties.CloneSubstructureAs<HyperCubeDef>(cubePath).Mode;
switch (cubeMode)
{
    case NxHypercubeMode.DATA_MODE_PIVOT: ...
    case NxHypercubeMode.DATA_MODE_PIVOT_STACK: ...
    case NxHypercubeMode.DATA_MODE_STRAIGHT: ...
    case NxHypercubeMode.DATA_MODE_TREE: ...
}