Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table Puzzle

I am super frustrated with this project at this point [:@] and need some help.

I have a Pivot table with the following dims (CustomerGroup, Origin, PickUpWeek)

Currently the expressions are as follows

Trips= Count(OrderNo)

5wk Average= GetSelectedCount(PickupWeek)

Note: Currently 5 weeks are selected but obviously this changes as more or less are selcted

The Table looks like this (See Lowest Example).

What i need is for the 5 wk average row to actually be a 5wk average, i.e. The Customer "C Valley"

Should have a an average of "9.0" (see total rows 45/5= 9.0) I would like this number to appear in all the cells below the Trip Count for that week and also a variance below them both i.e.

Customer..Origin...PickUpWeek 7/26/09....7/19/09..........

(CValley....ARZ......Trips....................10.................9..............

(CValley....ARZ........5wk Avg................9.................9..............

(CValley....ARZ........Variance...............1.................0..............

Anyone have any ideas? You would be a life saver!!!!!

[;)]

CustomerGroupOriginPODPickupWkStart7/26/20097/19/20097/12/20097/5/20096/28/2009Total
ATSARZTrips032005
ATSARZ5 Wk Avg.5.05.05.05.05.05.0
C VALLEYARZTrips109881045
C VALLEYARZ5 Wk Avg.5.05.05.05.05.05.0
CHIQARZTrips000134
CHIARZ5 Wk Avg.5.05.05.05.05.05.0
COSTARZTrips2211410
COSTARZ5 Wk Avg.5.05.05.05.05.05.0
1 Solution

Accepted Solutions
johnw
Champion III
Champion III

This, maybe?

count(total <CustomerGroup,OriginPOD> OrderNo)/5

View solution in original post

4 Replies
Not applicable
Author

could you upload your QV ?

johnw
Champion III
Champion III

This, maybe?

count(total <CustomerGroup,OriginPOD> OrderNo)/5

Not applicable
Author

I can not up load the qv at this time but i can tell you hat i have adjusted so far.

Keeping the same dimensions

I changed the Wk Average expression to "=avg(ALL aggr(sum(TripCounter), CustomerGroup))"

This is giving me what i want if i only have one CustomerGroup selected:

CustomerGroupOriginPODPickupWkStart8/9/20098/2/20097/26/20097/19/20097/12/20097/5/20096/28/20096/21/2009Total
C VALLEYARZTrips9101098810872
C VALLEYARZ8 Wk Avg.72.072.072.072.072.072.072.072.072.0
TotalTrips9101098810872
Total8 Wk Avg.72.072.072.072.072.072.072.072.072.0

But if i have more than one it goes bad again and takes the total average of all the Customer Groups:

CustomerGroupOriginPODPickupWkStart8/9/20098/2/20097/26/20097/19/20097/12/20097/5/20096/28/20096/21/2009Total
C VALLEYARZTrips9101098810872
8 Wk Avg.30.330.330.330.330.330.330.330.330.3
CHIQ
ARZTrips000001326
8 Wk Avg.30.330.330.330.330.330.330.330.330.3
COSTARZTrips0022114313
8 Wk Avg.30.330.330.330.330.330.330.330.330.3
TotalTrips9101211910171391
8 Wk Avg.30.330.330.330.330.330.330.330.330.3

There has to be something i can add to the AGGR statemnet that will make it so it totals and averages each idividually.

Any ideas?

Not applicable
Author

Just a little tweeking for what i needed and it worked like a charm:

=count(total <CustomerGroup,OriginPOD> OrderNo)/GetSelectedCount(PickupWkStart)

I madeit a lot harder than it had to be.

Thanks for your help!!