Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Arjunarao
Honored Contributor II

Difference between two expressions

Hi All,

What is the difference between the below expressions?

1) =Avg(Aggr( Sum(Sells), Products ))

2)=Aggr( Sum(Sells), Products )

Table:

LOAD * INLINE [

Products,Sells

Product 1,10000

Product 2,60000

Product 3,70500

Product 4,45000

Product 5,50200

];

Capture.JPG

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Difference between two expressions

Hi,

You have only one record for each of the Product, if you have multiple records then you can see the difference.

Regards,

Jagan.

3 Replies

Re: Difference between two expressions

In this situation the AVG does not do much

As you already use AGGR to group you product AVG from this group will be the same as the AGGR.

and is the same as

=Avg(Sells)

MVP & Luminary
MVP & Luminary

Re: Difference between two expressions

Hi,

You have only one record for each of the Product, if you have multiple records then you can see the difference.

Regards,

Jagan.

MVP & Luminary
MVP & Luminary

Re: Difference between two expressions

Hi,

If you are using Product as dimension then there is no need of Aggr(), it should be used when there is no corresponding dimension used in the chart.

Below expressions also give the same result

1) =Avg(Sells)

2)=Sum(Sells)

Aggr() will have performance, so use it carefully whenever you need it really.

Regards,

jagan.