Qlikview, how to create an expression which does not change with listbox selection?

tastefullvenom picture tastefullvenom · Aug 5, 2013 · Viewed 21.1k times · Source

Example, I have table below..

Week, Quantity
1, 10
1, 15
1, 10
2, 20
2, 30
3, 10
3, 50

I also have a list box for 'Week' which is current selected on week 2.

Now, I want to create text object which shows the value of sum of quantity of week 1 (ie. 35), which will always show that result even when the list box is selected on week 2. How can I achieve this?

Currently I managed to do an expression which sums week 1 but as soon as I select week 2 it shows 0 ....

Answer

smartmeta picture smartmeta · Aug 6, 2013

Enter the following to your textfield:

= 'Sum week 1 : ' & sum({$<Week={'1'}>}Quantity)

Use the '&' to concat values. And use the set analysis (Page 799 of the QlikView Reference Manual) to select the reqired values.

sum({$<Week={'1'}>}Quantity)

Read this like: Sum the values of 'Quantity' Where 'Week' is 1.