Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

sourabh808
New Contributor

.Net SDK to extract Master Dimensions and Measures from Qliksense Application

Hi,

I have connected to a particular Qliksense application and now am able to extract sheets, properties of each object on sheet.

Can anyone help to extract the Master Dimension and Measures from the application.

Thanks,

Sourabh

Labels (3)
5 Replies
Partner
Partner

Re: .Net SDK to extract Master Dimensions and Measures from Qliksense Application

Hi,

This might help you

https://community.qlik.com/t5/Qlik-Sense-Integration/QlikSense-Net-SDK-Retrieve-chart-dimensions-and...

or

create a Session object

{
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qType": "MeasureList"
},
"qMeasureListDef": {
"qType": "measure",
"qData": {
"title": "/title",
"tags": "/tags"
}
}
}
],
"outKey": -1,
"id": 5
}

Same for Dimension too with following updates

"qInfo": {
"qType": "DimensionList"
},
"qDimensionListDef": {
"qType": "dimension",

and call for getlayout() function

{
"method": "GetLayout",
"handle": 2,
"params": [],
"outKey": -1,
"id": 4
}

you will get the list of measures and dimensions

Tip : Qlik Dev-hub will help you with the same steps i suggested you 

Hope it will helpful 🙂

Regards,

Prashant

Employee
Employee

Re: .Net SDK to extract Master Dimensions and Measures from Qliksense Application

An example of how to list master measures can be found here:

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

Similar process for master dimensions...

Partner
Partner

Re: .Net SDK to extract Master Dimensions and Measures from Qliksense Application

sourabh808
New Contributor

Re: .Net SDK to extract Master Dimensions and Measures from Qliksense Application

Thank you for your responses.

I was able to extract the master items, but i am now stuck how do we get the expressions for the particular master dimension/ measure.

 

Employee
Employee

Re: .Net SDK to extract Master Dimensions and Measures from Qliksense Application

Once you have opened the master dimension/measure, then you can access the definition through it's properties. Something like this:

var masterMeasure = app.GetGenericMeasure(<the id of the master measure>);
var measure = masterMeasure.Properties.Measure;
Console.WriteLine(measure.Def);