# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$400 before Dec 31st: REGISTER NOW!
cancel
Showing results for
Did you mean:
Creator III

## Avg sales of 4 companies Qlik Sense

Hi

I need to obtain the average sales of 4 companies in a column I am using a pivot table.

My dimension is  = Company

Expression is = round(avg(aggr( count(distinct ORDERSALES)/count(distinct DAY) , Month, SELLER)),1)

But in it I only have 4 companies I need to add a fifth that would be the global sales.

For example

Company E has the average sales of the 4 companies.

1 Solution

Accepted Solutions
Specialist

Hi Mario,

We can do it by using Total of dimension and SecondaryDimensionality() function. The result is:

For the position of the Total column, you can try some pivot extensions on qlik branch, as far as i know the original pivot table in QlikSense doesnt allow you to change it.

For detail, please have a look at the attached application.

Best.

2 Replies
Specialist

Hi Mario,

We can do it by using Total of dimension and SecondaryDimensionality() function. The result is:

For the position of the Total column, you can try some pivot extensions on qlik branch, as far as i know the original pivot table in QlikSense doesnt allow you to change it.

For detail, please have a look at the attached application.

Best.

Creator III
Author

I thank you Quy, I have been able to take this example as an example and I have adapted it to my project.

Expression :

If(SecondaryDimensionality()=0, Round(Avg(Aggr(count(distinct ORDERSALES)/count(distinct DAY),MONTH,SELLER))),

round(avg(Aggr(count(distinct ORDERSALES)/Count(distinct DAY),MONTH,SELLER))))

Tags
Community Browser