Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
I would need to change the active measure on a chart based on a combo box selection in my mashup. The measures are defined in the measures section. I thought the easiest way to do this would be to assign all the measures as alternatives dimensions and set the active one using the mashup API. But I cannot find the method to set the active alternative measure in the documentation.
Is there an API method to set the active measure in a chart? Otherwise, can we change programmatically the measure? I know I can set variables, but I cannot call a measure using a variable as far as I know...
You could use a variable instead and use the variable extension on Qlik Branch. That way you could also change a number of charts, KPIs etc at the same time, with just one click.
Hope this helps
I did not find how to point to predefined measures, but we are now using variables for each measure, so it would be easy to switch between them.
LET vL.ClientCost = SUM([Client Costs Field])
LET vL.ClientRevenue = SUM([Client Revenues Field])
LET vL.SwappableMetric = $(vL.ClientCost)
And in your metrics, you could simply use the variable value.
For example, My [Client Costs] metric would be $(vL.ClientCost).
Hope this helps!