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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

getting data from pivot table with multiple dimensions

Hi,

While trying to extract data from pivot-table that has more than one dimension  I noticed that I receive only the measures from the hypercube,

In the following example pt_dim.Count()=3 and pt_m.Count()=2 and numOfColumns= 2.

I also noticed that the HyperCubeMode is DATA_MODE_PIVOT_STACK and I tried to change it but it didn't work.

This also happens in linechart with multiple dimensions.

The code:

IGenericObject iGenObj = (IGenericObject)iapp.GetGenericObject(objId);

Pivottable pt = (Pivottable)iGenObj;

mode = pt.Properties.HyperCubeDef.Mode;//mode=NxHypercubeMode.DATA_MODE_PIVOT_STACK

IEnumerable<HyperCubeDimensionDef> pt_dim = pt.Properties.HyperCubeDef.Dimensions;//pt_dim.Count()=3

IEnumerable<HyperCubeMeasureDef> pt_m = pt.Properties.HyperCubeDef.Measures;//pt_m .Count()=2

HyperCubePager hcp = pt.HyperCubePager;

int numOfColumns = hcp.NumberOfColumns;//2

int numOfRows = hcp.NumberOfRows;

       

IEnumerable<NxDataPage> pages = hcp.GetData(new[] { new NxPage { Top = 0, Height = numOfRows, Left = 0, Width = numOfColumns } });

IEnumerable<NxCellRows> rows = page.Matrix;

//The matrix contains only measures columns data.

...

Thanks in advanced,

Moran

0 Replies