Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

average of rows in a column

Hi all.
I have a table as this:
1 dimension: Year
3 expression: Employees, Cost, NewValue
YearEmployeesCostNewValue
20114130014400
20125270018000
20137680025200
I want calculate the colum NewValue. It is given: avarege of all the value in the column cost multiplied by each value of the column Employees.
14400 = (1300+2700+6800)/3 * 4
18000 = (1300+2700+6800)/3 * 5
25200 = (1300+2700+6800)/3 * 7

any ideas?
Thanks!
17 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Something like this:

     =Avg(Total Cost) * Only(Employees)

OR

     =Avg(Total Cost) * Sum(Employees)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

=Avg(Total Cost) * Only(Employees) no work

=Avg(Total Cost) * Sum(Employees) give me no correct value

er_mohit
Master II
Master II

(Sum(TOTAL Cost)/Count(TOTAL Cost))*Employees

Not applicable
Author

no work

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the application attached here with.

     If this is not how your data structure is then kindly upload the qvw file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nayanpatel
Partner - Creator
Partner - Creator

=Avg(Total(cost))*Employee

Not applicable
Author

Hi

=sum(avg(total(cost)))*employee

try this, it will work.

Anish

Not applicable
Author

I supose in table you have Sum(Cost) and Count(Employees);

If true,try:

=sum(total Cost) / count(total distinct Year) * count(Employees)

Not applicable
Author

If in expression you have Cost and Employees like is seen in table(no aggr functions like sum,count) try:

=sum(total Cost)/count(total distinct Year) * Employees