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: 
gwendolineMeta
Contributor II
Contributor II

API .Net : Get measure and dimension for autochart in sheet

hi,

In my second shheet, I added a simple measure and simple dimension

gwendolineMeta_0-1722864606692.png

How can I get this measure and dimension ?

I try with the public examples (https://github.com/AptkQlik/PublicExamples) but there are  no case for "auto-chart"

gwendolineMeta_1-1722865099060.png

Is it possible to get the linked fields?

 

For the first sheet I call app.GetMeasureList() to get the  measure but for the measure in the second sheet it's doesn't work

gwendolineMeta_2-1722865513766.png

 

Thank

Gwendoline

Labels (1)
  • API

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

You don't really need those client classes to access that info. You can rely on the "AbstractStructure" class to get you the information you need. I have an example focusing on hypercube usage here that might be of use to you:

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

In particular, have a look at this line which reads a segment of "GenericObjectProperties" and interprets it as being of type "HyperCubeDef":

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

Once you've done that, you can access the structure as an instance of the "HyperCubeDef" class.

All those classes from the Client namespace are there primarily to provide a typed layer for accessing entities in the client objects. That part is only partially part of the official API though, so it's not been maintained for quite a while as there is no formal spec available for the different properties of those client object. But the "HyperCubeDef" class is defined based on the engine API, so there is a formal definition available here:

https://help.qlik.com/en-US/sense-developer/May2024/Subsystems/EngineJSONAPI/Content/models-hypercub...

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

For the auto-chart the Properties.HyperCubeDef contains the measures, just like a barchart. If you want to use the example code just duplicate the barchart line for auto-chart. 

-Rob

gwendolineMeta
Contributor II
Contributor II
Author

I don't found the class to cast for auto-chart (for Barchart, a class  exist)

I try  with visualizationBase but Properties.HyperCubeDef doesn't exist.

My object (genericObject) doesn't contain Properties.HyperCubeDef.

gwendolineMeta_0-1722931023059.png

NB: I used the last version  QlikSense.NetSDK 16.8.0

Øystein_Kolsrud
Employee
Employee

You don't really need those client classes to access that info. You can rely on the "AbstractStructure" class to get you the information you need. I have an example focusing on hypercube usage here that might be of use to you:

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

In particular, have a look at this line which reads a segment of "GenericObjectProperties" and interprets it as being of type "HyperCubeDef":

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

Once you've done that, you can access the structure as an instance of the "HyperCubeDef" class.

All those classes from the Client namespace are there primarily to provide a typed layer for accessing entities in the client objects. That part is only partially part of the official API though, so it's not been maintained for quite a while as there is no formal spec available for the different properties of those client object. But the "HyperCubeDef" class is defined based on the engine API, so there is a formal definition available here:

https://help.qlik.com/en-US/sense-developer/May2024/Subsystems/EngineJSONAPI/Content/models-hypercub...

gwendolineMeta
Contributor II
Contributor II
Author

it's work fine for me

Thank you