Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fanninam
Creator
Creator

Average

I'm trying to get the following statement to take an average of the EjFTE:

Sum({$<HCOE={'Human Costs'},[Year]={$(=Only(Year))}>}Actaul_Amount)/Sum({<[Years]={$(=(Only(Years)))}>}(EjFTE))

Labels (1)
4 Replies
Not applicable

Please provide screenshot of what you are getting with the above expression and what are you expecting in the end result.

MK_QSL
MVP
MVP

Replace Only with Max

mendoncart
Contributor III
Contributor III

Hi.

I'm a noob on Qlik, but I'll try to help, in return of all the help I got here.

Are you getting any result out of this formula?

I think you're missing some quotes.

If this is the case, assuming the rest is right, try this:

Sum({$<HCOE={'Human Costs'},[Year]={'$(=Only(Year))'}>}Actaul_Amount)/Sum({<[Years]={'$(=(Only(Years)))'}>}(EjFTE))

Maybe I'm completely wrong. I hope not. But if I am, someone with more knowledge will aid.

Not applicable

Hello,

To get the average you should divide it by count. You have Sum/Sum. That doesn't look right.

What is EjFTE? is it a text field?

And when you use Only , make sure you have only one value selected in Year field.  only returns only one value, if it finds multiple possible values in year then it will return null.