Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
kwdaniels
Partner
Partner

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.

1 Solution

Accepted Solutions
yko
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
yko
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

kwdaniels
Partner
Partner
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");