3

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

smartmeta
  • 1,149
  • 1
  • 17
  • 38
tastefullvenom
  • 31
  • 1
  • 1
  • 2

3 Answers3

3

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.

smartmeta
  • 1,149
  • 1
  • 17
  • 38
1

Replace the '$' with '1' and the expression will ignore current selection e.g.

sum({1<Week={'1'}>}Quantity)
Gan CW
  • 11
  • 1
1

do this:

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

That is basically telling Qlikview regardless of what is selected in Qlikview, that expression will always calculate as if Week 1 is selected.

Shaun
  • 559
  • 1
  • 3
  • 17