Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Refer to expression in other chart

Is it possible to refer to an expression in an other chart? I can't reuse the same expression.

17 Replies
Anil_Babu_Samineni

What is the question here, I would say yes it is possible to use

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

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?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

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:

Knipsel.PNG

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:

Knipsel2.PNG

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).

avinashelite

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

Not applicable
Author

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?

avinashelite

In this case you need to have an AGGR() on the Level 1

Not applicable
Author

Sorry I'm very new to QlikView, how should the code look?

avinashelite

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

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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?