Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am currently trying to extend a new master element based on another master element including outer function:
As an example:
Master element 1= Sum({$<Year={2012}>} Sales)
Masterelement 2= {<Country={'Germany'}>} Master Element
The problem, it does not work. As soon as there is a Set Analysis in the upstream master key figure, there is no reaction. As long as I remove it, it works.
Bug or feature?
Thanks and greetings
Hi @Danijel
Try this as a single master measure
{<Country={'Germany'}>}Sum({$<Year={2020}>} Sales)
This works.
The set analysis {<Country={'Germany'}>} doesn't work when using the function editor at all.
It works when combining as above.
I believe it is by design.
kind regards...
Hello, I understand that you want to obtain the sales in the year 2012 of the country Germany. If so, I send you an expression.
Sum({<Year={'2012'}, Country={'Germany'}>} Sales)
regarts.
Thank you for the answers.
I already know the suggestions, but I have a "basic formula" that I would like to reuse in other master elements.
Therefore, the suggested methodology is unfortunately of no use to me. I used to implement this with variables and placeholders.
I will create another idea for this.
@Danijel I would rather suggest you to use variables and master items in combination.
variables can store your outer set expression, for example:
eOuterExp1 = {<Country={'Germany'}>}
eOuterExp2 = {<Year={2012}>}
master item can store lowest level of expression without any set analysis, for example: Sum(Sales)
then combine them for better reusability
$(eOuterExp1)$(eOuterExp2)Master Item
Beside of the feature of the master elements I'm not sure if the combination of inner and outer set analysis is possible and also sensible as a general approach. Like by the work with variables the aim is to simplify the development and maintaining and by an overuse it reverts easily into the opposite. Background to these thoughts is the following discussion:
Outer SetAnalysis modifier ignored - Qlik Community - 2108889
Maybe it's related to your scenario.
@marcus_sommer I agree with you on this. Also, we usually do not have set expressions defined to a specific year/month or date rather it is relative or dynamic. So having a variable which stores dynamic values reduces the redundancy of creating multiple objects that needs to be maintained.
Hello @Danijel,
You should remove the $-sign from your expression. Then it should work.
Master element 1= Sum({<Year={2012}>} Sales)
You can read about the inheritance rule here:
BR,
Rumen