Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression Library

Hi,

Is there any concept on an 'Expression Library' in QV? For example, I use the same expression in numerous charts etc and if I need to change it I therefore have to remember all the places it has been used and go through and update them all. It would be much simpler if I could define a label for an expression and then just update it in one place.

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Three suggestions If you put the expression into the script you only have to maintain it in one place or are you familiar with Expression Overview, CTRL+ALT+E you can view all of the expressions here and use find and replace. Finally I assume that now you can export the structure to an XML file you could globally edit that and reload.

View solution in original post

5 Replies
Not applicable
Author

Hi,

Three suggestions If you put the expression into the script you only have to maintain it in one place or are you familiar with Expression Overview, CTRL+ALT+E you can view all of the expressions here and use find and replace. Finally I assume that now you can export the structure to an XML file you could globally edit that and reload.

Not applicable
Author

We use variables for expressions. For instance sum(sales) for variable "Sales" and refer to it with $(Sales) in your expressions.

/Michael

Not applicable
Author

You could (should?) review expressions you use more than once and try to make them a field in the load script, e.g. instead of an expression in a table calculating a true or false, calculate it in the load script and set a field as 1 or 0, or Y or N, or ... then use the new field in the table.

This is sometimes difficult, but it will speed up the display of tables when selections change and may slow down the load, which can be scheduled at night when no-one cares how long it takes.

Not applicable
Author

Absolutely, and I do. This is more for expressions that perform aggregations and are thus dependant on the dimensional context they are used within. For those I will try to use variables and see how I get on.

Michael - the expressions contained within these variables will be re evaluated whenever a selection is made in the qlikview document, correct? i.e. they aren't just evaluated when the QV file is first opened are they? That would suggest I will only get static values.

Not applicable
Author

Define the variables with "SET varValue = ..." rather than "LET varValue = ..." and it stores it as a string, rather than evaluating it when the QV is opened. Using variable expansion inserts the string, which is then evaluated.