Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

kunkumnaveen
Contributor III

how to write this exp

HI All,

How to write this expression,

week          quantity        tm

week1           100             10

week1             200             20

week1              50               5

week2          800               80

week2             120            20

week2            500              5 5

if i select week1 from week i should get this=

                                                     100*10+200*20+50*5

                                                      -------------------------------

                                                            100+200+50

if i select week2 from week i should get this=

                                                         800*80+120*20+500*55

                                                        --------------------------------------

                                                               800+120+500


a dynamic exp which should change with selection


thanks

1 Solution

Accepted Solutions

Re: how to write this exp

May be this:

Sum(quantity*tm)/Sum(quantity)

Update: I hope that you are using this in a text box object, right?

If you are not, then may be this:

Sum(TOTAL quantity*tm)/Sum(TOTAL quantity)

or

Sum(TOTAL <week> quantity*tm)/Sum(TOTAL <week> quantity)

2 Replies

Re: how to write this exp

May be this:

Sum(quantity*tm)/Sum(quantity)

Update: I hope that you are using this in a text box object, right?

If you are not, then may be this:

Sum(TOTAL quantity*tm)/Sum(TOTAL quantity)

or

Sum(TOTAL <week> quantity*tm)/Sum(TOTAL <week> quantity)

kunkumnaveen
Contributor III

Re: how to write this exp

i tried in textbox ,its working actually i need this exp for one of my bar chart ....i will try the two other exp

can u say wats the diff b/w these exp...

Sum(TOTAL quantity*tm)/Sum(TOTAL quantity)

or

Sum(TOTAL <week> quantity*tm)/Sum(TOTAL <week> quantity)


what actually this does <week>


Community Browser