Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

francis_gr
New Contributor III

weighted average

Hi!

In my attached file, there is a table (weighted average) where i need to compare the average of each user with the average (weighted) of the users of the same area and Department .

I appreciate your help.

Thanks in advance

6 Replies
Partner
Partner

Re: weighted average

Hi,

try like this:

avg of the user : avg (field)

avg of area and department : avg ( total <area, department> field)

francis_gr
New Contributor III

Re: weighted average

Hi StarinieriG!

Thanks for your reply but your indicacion doesn't solve my problem. Your expression just show the average of the Ded_day field regardless of the year or month selected or the area or department to which the user belongs.

For example, for user 2, if selected year is 2019 and month 1, weighted average value for his area (HR in my example) must be 3,608

 

area

Dep (ofic field)

Num Users (A)

sum Ded_day (B)

cal (A*B)

 

HR

RES

3

4,04

12,12

  

RLA

2

2,96

5,92

Tot

  

5

 

18,04

    

Result

18,04/5= 3,608

 

Regards

Support
Support

Re: weighted average

Adding a comment to kick this one back up in the list given you attached a QVW to see if anyone else may have any ideas on things.  Unfortunately I am not too swift with the development items.  About the best I could guide you would be to check out the Design Blog area and the posts there to see if you can find something that will help:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Maybe this one specifically:

https://community.qlik.com/t5/Qlik-Design-Blog/Average-Which-average/ba-p/1466654

Sorry I do not have anything better for you.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
francis_gr
New Contributor III

Re: weighted average

Hi! Really appreciate your help. I've been checking the links and I've seen interesting things that I didn't know. Given my knowledge, I don't see the way to get the data I need. It may be too complicated Thank you for your help and for your time. Regards

Re: weighted average

Hi, in your document when I select 2019, january and area HR I see 6 different users, not 5.

Also I can't see how you wnat to see those results, it's a text with a global result? should be in a table like the one in this post?

Can you post a sample with the values you expect and the way you want to see them?

francis_gr
New Contributor III

Re: weighted average

Hi rubenmarin !

In the Weighted average table I calculate the average of the field I need to compare the average of the ded_day field for each user of both the selected period and the same period of the previous year. In principle I don't know if using the avg function is correct. What I need is in a table (or graph) to compare the average of the field ded_day of each user with the average of the same field of the department (Dep) and Area (Area) to which they belong in the year (and month or months selected) and from the same period of the previous year.

So in the table must appear the user, their average of the ded_day field for the selected period and the average of the same field for the area and department to which it belongs

taking into account that an area can contain one or more departments

Thank's for your time and your interest in help!