Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Madhab77
Contributor III
Contributor III

I need to have an average on the top of each column of a pivot table in qliksense

Hi All I have the following pivot table (without the red color one).

Employee
Appointment DateAverage     
 06-14-202106-15-202206-16-202306-17-202406-18-2025and so on 
 Avg: 3.33Avg: 3.35Avg: 3.16Avg: 2.66Avg: 2.5Avg: 3.16 
A415444 
B3-4334 
D5565-- 
E35-44- 
F-4--45 
G564--6 

 Now I need as the Average value in each column as displayed in the image. It should also alter the result accordingly when I select employee(s).

Can anybody help me out to achieve this?

 

Thanks in Advance.

Madhab Sikder

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Vegar_0-1592309018152.png

What if you calculate avg like this: sum(Value)/count(Employee)

See attached qvf

View solution in original post

10 Replies
Vegar
MVP
MVP

You could try to use rangeavg () to solve your problem.

help.qlik.com - rangeavg()

 

Madhab77
Contributor III
Contributor III
Author

Hi Vegar,

Thanks for you reply. But unfortunately, it is not giving the desired result. It may work for simple table, but it is not working for pivot table.

Can you please provide some example, if you have anything handy.

 

Thanks,

Madhab Sikder

 

Vegar
MVP
MVP

Ok i see. 

What about an avg aggr avg expression then?

Avg(Aggr(Avg(Value), [Appointment date])) 

Saravanan_Desingh

One  simple solution is.

tab1:
LOAD *, RangeSum(Value,0) As V2;
LOAD * INLINE [
    Employee, Appointment Date, Value
    A, 6/14/2021, 4
    A, 6/15/2022, 1
    A, 6/16/2023, 5
    A, 6/17/2024, 4
    A, 6/18/2025, 4
    A, 6/19/2026, 4
    B, 6/14/2021, 3
    B, 6/15/2022, 
    B, 6/16/2023, 4
    B, 6/17/2024, 3
    B, 6/18/2025, 3
    B, 6/19/2026, 4
    C, 6/14/2021, 5
    C, 6/15/2022, 5
    C, 6/16/2023, 6
    C, 6/17/2024, 5
    C, 6/18/2025, 
    C, 6/19/2026, 
    D, 6/14/2021, 3
    D, 6/15/2022, 5
    D, 6/16/2023, 
    D, 6/17/2024, 4
    D, 6/18/2025, 4
    D, 6/19/2026, 
    E, 6/14/2021, 
    E, 6/15/2022, 4
    E, 6/16/2023, 
    E, 6/17/2024, 
    E, 6/18/2025, 4
    E, 6/19/2026, 5
    F, 6/14/2021, 5
    F, 6/15/2022, 6
    F, 6/16/2023, 4
    F, 6/17/2024, 
    F, 6/18/2025, 
    F, 6/19/2026, 6
];

 

Saravanan_Desingh

Do the changes in the Presentation tab.

commQV30.PNG

commQV29.PNG

Madhab77
Contributor III
Contributor III
Author

Hi Saran,

Thank you very much for you info.. But unfortunately I am not getting the exact result in QlikSense, it may work for QlikView. The reason may be because of the subtotal option/partial sum, in Qliksense, the subtotal/partial sum option is not available.

Please find the screenshot which I got after implementing your logic.

Madhab77_0-1592300048504.png

Here I am getting same average for all the columns. If I select a particular date, then I am getting the exact result, but not when multiple dates or non.

 

Thanks

Madhab

Madhab77
Contributor III
Contributor III
Author

Hi Vegar,

Still I am not getting my desired result.

Note: I want this in QlikSense.

Below is the screenshot which I am getting after using the Avg(Aggr(Avg(Value), [Appointment date])) 

Madhab77_0-1592299809984.png

Please let me know if  I am missing anything.

 

Thanks 

Madhab Sikder

Vegar
MVP
MVP

Vegar_0-1592309018152.png

What if you calculate avg like this: sum(Value)/count(Employee)

See attached qvf

Madhab77
Contributor III
Contributor III
Author

Hi Vegar,

Thank you so much. It worked this time. You helped a lot.

Thank you once again.

Madhab Sikder