# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## Using Aggregation to obtain basket size

Hi all,

This is my first post, though I have been visiting for a little while.

I have an issue that I hope somebody can help with and hopefully improve my understanding at the same time.

I am trying to find the frequency of basket sizes against a set of sales. I have a unique identifier for a sale as [Sales invoice] and I count the unit quantity by line item (product) as [Units Sold].

e.g.

[Sales invoice][SKU][Units Sold]
INVOICE123PRODUCT13
INVOICE123PRODUCT21
INVOICEABCPRODUCT37
INVOICE999PRODUCT24

My attempt to find the above is to use the following:

AGGR(SUM([Units Sold]), [Sales invoice])

However this results in inaccurate quantities. Where the above should show (Basket Size 4 = Frequency 2, Basket Size 7 = Frequency 1), instead it is showing inflated numbers which do not seem to match anything I can find.

Hopefully I have explained that clearly, any help would be much appreciated.

Michael

Tags (1)
1 Solution

Accepted Solutions

## Re: Using Aggregation to obtain basket size

Try this as calculated dimension: =aggr(sum(total [Units Sold]),[Sales invoice])

And this expression: count(distinct SKU)

talk is cheap, supply exceeds demand
2 Replies

## Re: Using Aggregation to obtain basket size

Try this as calculated dimension: =aggr(sum(total [Units Sold]),[Sales invoice])

And this expression: count(distinct SKU)

talk is cheap, supply exceeds demand
Not applicable

## Re: Using Aggregation to obtain basket size

Hi Gysbert,

I removed "total" in your expression above as it was not present in your example and it worked!