This is working as designed starting from Qlik Sense February 2021 version.
There is a strict order of preference for resolving conflicts between identically named entities (i.e. field-, variable or label-names) and this order is reflected in any objects or contexts, where these entities may be used. Inside an aggregation, a name will always be interpreted as a field name first and a variable name second. Label names are not relevant in aggregations and are “softer” when it comes to an order of precedence.
Outside an aggregation, it makes sense to re-use an expression and this can be done by referencing it’s label (unless the label is in fact a calculated one – in which case it drops in significance in order to reduce risk of self-reference) and in this case the name will always be interpreted first as a label name, second as a field name and thirdly as a variable name.
However, this order of precedence is further complicated by the fact that a master-measure (i.e. a global expression) can be referenced outside the context of a specific object which means that the order of preference mentioned above will be enforced in all expressions at the document level and not just expressions that are local to a specific object.
N.B. It is always considered good practice to keep field names separate from variable names or label names and making sure, never to assign the same name to more than one entity. (This is extremely important with master measures).
Information provided on this defect is given as is at the time of documenting. For up to date information, please review the most recent Release Notes, or contact support at support.qlik.com with the below for reference ID.
QB-4400
HLP-9652 - for updating the Help site with relevant details.
EN-3073 - improvement suggestion
Workaround:
It is always considered good practice to keep field names separate from variable names or label names and making sure, never to assign the same name to more than one entity. (This is extremely important with master measures).
Fix Version:
Improvement suggestion ID: EN-3073 is in place to enable/disable this feature using Settings.ini (independent from feature flag service) and it is in process.