Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average functions

Hello, I've only just started working with QlikView this week as the company I work for is transitioning to it from Cognos and Excel.

We currently have a customer segmentation model built in Excel which I would like to replicate in QlikView.

Where I'm struggling is calculating average gross sales for our customer base as a whole.

I have a straight table that looks like this:

Location_IDGross SalesGross MarginN. SKUs purchasedAverage SKUs purchased Average gross sales
131.510
2214
310.52
4215

I'm struggling to fill the last two columns with the data I want for subsequent calculations. The last two columns should contain the same number all the way from the top to the bottom. Average SKUs in the example above would be 5.25 and Average gross sales would be 2.

What function should I be using and how should I be scripting it? Is it a variation on Aggr?

Thanks for your help,


Peter

6 Replies
Not applicable
Author

Hi Peter, If you just use Avg(Total [Gross Sales]), that should work.

Not applicable
Author

hi

sum(Total GrossSales)/count(GrossSales)

Not applicable
Author

Hi Peter,

For Average SKUs purchased, you can use : =AVG (TOTAL [N. SKUs purchased]) and for Average gross sales you can use : =AVG(TOTAL [Gross Sales])
Hope this helps!

jsingh71
Partner - Specialist
Partner - Specialist

Hi,

I you want below output:

Average.png

Then you need to add two expressions for calculating average.

 

1). Avg([N. SKUs purchased])

2). Avg([Gross Sales])

Anonymous
Not applicable
Author

Thanks for your replies, I've managed to get the right answer for the the Average SKUs for which I used this:

=avg(Total Aggr(count(SKU), location_id)

Rather than have different values against each location I want to have the same value against each. I hope that makes some sort of sense?

Anonymous
Not applicable
Author

Thanks for your replies, I've managed to get the right answer for the the Average SKUs for which I used this:

=avg(Total Aggr(count(SKU), location_id)

Rather than have different values against each location I want to have the same value against each. I hope that makes some sort of sense?