Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've noticed that now you can use master measure in another master measure, eg.:
Meas. 1 TotalAmount = Sum(Amount)
Meas. 2 TotalQty = Sum(Qty)
Meas. 3 Average = TotalAmount/TotalQty
If you put in a table all the three master measures they work fine, but if you remove Meas1 or Meas2 you have null in the Meas3 column.
The same apply if you use Meas3 alone.
Anyone has solved the issue?
thanks in advance
You can't use master measures as if they are variables. The measures only make sense in the context of the object they're used. What you want instead is variables and use those. In Qlik Sense 2.1 you can create variables in the user interface. In older versions you need to create them in the script.
SET vTotalAmount = sum(Amount);
SET vTotalQty = sum(Qty);
LET vAverage = '$('& 'vTotalAmount)/$(' & 'vTotalQty)';
You can then use the variables in the measures:
=$(vTotalAmount)
=$(vTotalQty)
=$(vAverage)
Hi,
you can can move measure definitions to variables:
Meas. 1 TotalAmount = $(vTotalAmount)
Meas. 2 TotalQty = $(vTotalQty)
Meas. 3 Average = $(vAverage)
Variables:
vTotalAmount = Sum(Amount)
vTotalQty= Sum(Qty)
vAverage = $(vTotalAmount)/$(vTotalQty)
You can't use master measures as if they are variables. The measures only make sense in the context of the object they're used. What you want instead is variables and use those. In Qlik Sense 2.1 you can create variables in the user interface. In older versions you need to create them in the script.
SET vTotalAmount = sum(Amount);
SET vTotalQty = sum(Qty);
LET vAverage = '$('& 'vTotalAmount)/$(' & 'vTotalQty)';
You can then use the variables in the measures:
=$(vTotalAmount)
=$(vTotalQty)
=$(vAverage)
Thanks for your reply, for end-users was easier to use Master Items instead of variables.
Anyway you (and Alex) are right.
You can still use the Master Items. You just have to create them using the variables.
I created a short video on how to re-use master items.