Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Using an aggregated value for all of the values of the same Aggr()

Hello!

Sorry for the confusing title, I think an example will makes things a little easier.

Let's say I have this table:

CustomerDaySales
A120
B230
C315
A425
B535

And now I add the  the aggreggation of the sum sales based on customer (syntaxis might be wrong, doing it from memory) aggr(sum(sales),Customer), that leaes me with the following table:

CustomerDaySalesAggr
A12045
B23065
C31515
A425-
B535-

So as you can see, when aggregating my table puts the value only in the first Customer it finds(or I don't know the logic behind), if I wanted to do something like a new column Sales/Aggr the output would be the following one:

CustomerDaySalesAggrRatio
A120450.44
B230650.46
C315151
A425--
B535--

So some columns won't calculated... Ideally what I would like is to have the aggregation of the sum repeated on each value 'Customer' that corresponds to.

Thank you!

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

Re: Using an aggregated value for all of the values of the same Aggr()

You need a NODISTINCT within aggr(), like:

aggr( NODISTINCT sum(sales),Customer)

4 Replies

Re: Using an aggregated value for all of the values of the same Aggr()

Hi,

You are almost there just use sum() before your aggr()

like sum(aggr(sum(sales),Customer))

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
MVP
MVP

Re: Using an aggregated value for all of the values of the same Aggr()

You need a NODISTINCT within aggr(), like:

aggr( NODISTINCT sum(sales),Customer)

Re: Using an aggregated value for all of the values of the same Aggr()

May be just this

Sum(TOTAL <Customer> Sales)

Check this out

Qlik Tips: No nodistinct

Not applicable

Re: Using an aggregated value for all of the values of the same Aggr()

This worked!

Thank you very much .