Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to refer to an expression in an other chart? I can't reuse the same expression.
What is the question here, I would say yes it is possible to use
If you mean a function or method to read the results in one sheet object (chart/table/list) in another sheet object, then no, that is not possible. You have to re-enter the expression in the second object.
>>I can't reuse the same expression.
Why not?
I will explain why I can't simply reuse the same expression with a simple example.
In the first chart, I divide sales by volume which gives me the unit price. I use a high level hierarchy dimension for this chart:
In the second chart, I also divide the sales by volume to get the unit price, but now with another dimension, which is more in depth than the dimension in the first chart:
Here comes the trick: I want to make an expression in the second chart that uses the unit price from the first chart (high level hierarchy).
One way to do this ...add the expression definition to a variable and use the same variable in different charts this is the way to reuse the expression in different charts
Thanks for your advice. How can I make sure that the variable is calculated based on product hierarchy level 1 when level 2 is also in the table?
In this case you need to have an AGGR() on the Level 1
Sorry I'm very new to QlikView, how should the code look? ![]()
aggr(expression,Level1) this will aggr the sum on the Level1 respective of the other dimensions
NOTE: you need to have Level1 as the dimension in the chart
You can reproduce the behavior of the first expression in the second chart using the TOTAL keyword and all dimension fields that should be ignored. See the aggregation function syntax here: Sum - chart function ‒ QlikView
However, it seems to me that summing the Fruit Sales and Volume values in the second chart doesn't produce values that match the same values in the first chart. Shouldn't they?