Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Using the Qlik engine APIs, I am able to retrieve list of measures used in an application from my web app, but I can't find anything to also get the expressions used for measures.
Any help in this regard is appreciable.
Thanks in advance
Hi,
In your definition of the Measurelist you need to say what data you want to get for each measure by defining qData.
In the capabilities API you can do like this:
qInfo: {
qType: "MeasureList"
},
qMeasureListDef: {
qType: "measure",
qData: {
qMeasure: "/qMeasure"
}
}
}, setData);
Hope this helps
Erik Wetterberg
Hi,
In your definition of the Measurelist you need to say what data you want to get for each measure by defining qData.
In the capabilities API you can do like this:
qInfo: {
qType: "MeasureList"
},
qMeasureListDef: {
qType: "measure",
qData: {
qMeasure: "/qMeasure"
}
}
}, setData);
Hope this helps
Erik Wetterberg
Thanks a lot Erik. I came back from vacation and checked it, it is absolutely working fine.
cheers!!
Kiriti
Hi,
For dimensions it would be something like:
qDimensionListDef: {
qType: "dimension",
qData: {
qDim: "/qDim",
qDimInfos: "/qDimInfos"
}
}
Erik Wetterberg
Hi I would like to understand what this setData does?
I am creating the request this way:
qInfo: {
qId: 'mysessionobject',
qType: 'list'
},
qMeasureListDef : {
qType: "measure", qData: { title: "/title", tags: "/tags", measure: "/qMeasure" },
qInitialDataFetch: [{
"method": "GetLayout",
"handle": 2,
"params": [],
"outKey": -1,
"id": 4
}]
}
And printing it out to the console like this:
console.log(element.qMeta.title + ' : ' + element.qMeta.description + ' : ' + element.qData.measure);
console.log()
});
What returns to my console is this:
Sales : Sum of sales amount. : [object Object]
So qMeasure is not returning the expression you know how this can be fixed?
i know this is an old topic but it would really help my project.
I do the following after connecting to my app:
but as you can see in the file, it will not let me execute this query - is there something I am missing?
I can't see the full request window in that screenshot, but from what I see it looks like you are trying to use JavaScript code as the request. The Engine API explorer operates directly on the JSON RPC level, so you need to follow that format.
I don't know if this helps - but Kabir Rab made an add-on / visualisation for Qlik that uses the API to pull these in, unfortunately, it doesn't look like he's been working on it since 2020
https://github.com/kabir-rab/master-items-viewer
It works on some apps, but not on others, and I'm not proficient enough to figure out why, but this might be a great start for someone to fork, and update- as when it does work, I get back all the master dimension and measures, complete with formula etc.