Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kwdaniels
Partner - Creator
Partner - Creator

Can I use the .NET Engine API to access HyperCubeDef for an extension GenericObject like Simple KPI?

I able to use Qlik's C# App traverser to drill down into standard chart objects like tables and bar charts to obtain and update measure definitions via the objects' HyperCubeDef. I'm using an approach similar to the one mentioned here.

However, I'm not able to do this for an extension like Simple KPI.  This is because I'm not able to cast the GenericObject to a standard chart type.

Is there a way to access and update the measures that make up a Simple KPI using the Engine API? If so, could you advise me on how to do this using the .NET SDK.

Labels (8)
1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

The easiest way is to access the hypercube through the generic get and set methods of the AbstractStructure class. This example illustrates how to work with hyper cubes in the SDK:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage

This line shows how to get the cube definition:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L7...

And this shows how to set it:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L5...

View solution in original post

2 Replies
Øystein_Kolsrud
Employee
Employee

The easiest way is to access the hypercube through the generic get and set methods of the AbstractStructure class. This example illustrates how to work with hyper cubes in the SDK:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage

This line shows how to get the cube definition:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L7...

And this shows how to set it:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage/blob/master/HypercubeUsage/Program.cs#L5...

kwdaniels
Partner - Creator
Partner - Creator
Author

Thanks, Yko, works like a charm!

For anyone who's interested, the key line that allowed me to drill into the hypercube for a nonstandard generic object was line 79 in this file:

var theHyperCube = theObject.Properties.Get<HyperCubeDef>("qHyperCubeDef");