Qlik Sense provides the Master items
to create dimensions and measures to be reused in the Visualization
objects.
Each measure has a fixed label and, in some cases, we can use the measure name instead of the base expression to create new measures or for coloring a chart by expression.
For the purpose of this recipe, we will make use of the QS_Variables
app created in the previous recipe. Ensure that you have already loaded the variables from the variables spreadsheet.
- Open the
QS_Variables
application. - Open the
Sales
sheet and enter the Edit sheet mode for the sheet. - On the
Master items
section, go toMeasures
. - Add a new measure with the
$(fMargin %)
expression, and type inMargin %
as a label. - Add the
Margin %
measure to the existing table. - Go to the Data section and expand the properties of the newly added measure.
- Type in the following expression in
Background color expression
:
if([Margin %]<0,vRedColor)
- Add a new measure with...